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

-fx-pref-tile-width causes ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      Running 2.1.0-beta-b15

      Description

      The following style class is defined in a style sheet:

      .tile-pane {
          -fx-pref-tile-height: 74.0;
          -fx-pref-tile-width: 67.0;
          -fx-tile-alignment: bottom-center;
      }

      In the code, the style is added to a tile pane:

              TilePane tiles = new TilePane();
              tiles.getStyleClass().add("tile-pane");

      When the code is executed the following warning is received. If the -fx-pref-tile-width is removed, the warning is not received.

      WARNING: com.sun.javafx.css.StyleHelper transitionToState Failed to set css [StyleableProperty {property: -fx-pref-tile-width, converter: SizeConverter, initalValue: -1.0, inherits: false, subProperties: []}]

      java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
      at com.sun.javafx.css.StyleableIntegerProperty.applyStyle(Unknown Source)
      at com.sun.javafx.css.StyleableProperty.set(Unknown Source)
      at com.sun.javafx.css.StyleHelper.transitionToState(Unknown Source)
      at javafx.scene.Node.impl_processCSS(Unknown Source)
      at javafx.scene.Parent.impl_processCSS(Unknown Source)
      at javafx.scene.Parent.impl_processCSS(Unknown Source)
      at javafx.scene.Node.processCSS(Unknown Source)
      at javafx.scene.Scene.doCSSPass(Unknown Source)
      at javafx.scene.Scene.preferredSize(Unknown Source)
      at javafx.scene.Scene.impl_initPeer(Unknown Source)
      at javafx.stage.Window$10.invalidated(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
      at javafx.stage.Window.setShowing(Unknown Source)
      at javafx.stage.Window.show(Unknown Source)
      at javafx.stage.Stage.show(Unknown Source)
      at trythingsout.TryThingsOut.start(TryThingsOut.java:110)
      at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
      at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:722)

        Attachments

          Activity

            People

            Assignee:
            kwwong Kinsley Wong
            Reporter:
            jgordon Joni Gordon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: