Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8121910

ClassCastException when a CSS styleClass is applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7u6
    • 7u6
    • javafx

      Add the sample.css stylesheet from the samples directory.
      Drop a Button, and from the Look tab add the tree-cell styleClass : the following exception appears.
      We should handle this error case correctly, e.g. with a message in the message bar.

      SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: Button[id=button1, styleClass=button tree-cell], name: skinClassName, value: com.sun.javafx.scene.control.skin.TreeCellSkin]' for control Button[id=button1, styleClass=button tree-cell]
      java.lang.IllegalArgumentException: java.lang.ClassCastException@3abd6b1e
      at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at javafx.scene.control.Control.loadSkinClass(Control.java:967)
      at javafx.scene.control.Control.access$500(Control.java:70)
      at javafx.scene.control.Control$12.invalidated(Control.java:897)
      at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:86)
      at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:120)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:40)
      at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:13)
      at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:40)
      at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:771)
      at javafx.scene.Node.impl_processCSS(Node.java:6458)
      at javafx.scene.Parent.impl_processCSS(Parent.java:975)
      at javafx.scene.control.Control.impl_processCSS(Control.java:1058)
      at javafx.scene.Node.processCSS(Node.java:6426)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Node.processCSS(Node.java:6418)
      at javafx.scene.Scene.doCSSPass(Scene.java:404)
      at javafx.scene.Scene.access$2900(Scene.java:133)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:1850)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:290)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:392)
      at com.sun.javafx.tk.quantum.QuantumToolkit$8.run(QuantumToolkit.java:318)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
      at java.lang.Thread.run(Thread.java:662)

            jfdenise Jean-Francois Denise (Inactive)
            jcambon Jerome Cambon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: