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

[NumberAxis] ClassCastException after set style -fx-minor-tick-count

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      2.2.0b20, jdk 1.7.0_06-b22

      Description

      run this code :
       @Override
          public void start(Stage primaryStage) {
              XYChart chart = new LineChart(new NumberAxis(0, 5, 1), new NumberAxis(0,5, 1));
              chart.getXAxis().setStyle("-fx-minor-tick-count:2");
              StackPane root = new StackPane();
              root.getChildren().add(chart);
              Scene scene = new Scene(root, 300, 250);
              primaryStage.setTitle(VersionInfo.getRuntimeVersion());
              primaryStage.setScene(scene);
              primaryStage.show();
          }

      output :
      WARNING: com.sun.javafx.css.StyleHelper transitionToState Failed to set css [StyleableProperty {property: -fx-minor-tick-count, converter: SizeConverter, initalValue: 5, inherits: false, subProperties: []}]

      java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
      at com.sun.javafx.css.StyleableIntegerProperty.applyStyle(StyleableIntegerProperty.java:31)
      at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
      at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:848)
      at javafx.scene.Node.impl_processCSS(Node.java:7324)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1153)
      at javafx.scene.Node.processCSS(Node.java:7292)
      at javafx.scene.Scene.doCSSPass(Scene.java:444)
      at javafx.scene.Scene.preferredSize(Scene.java:1411)
      at javafx.scene.Scene.impl_preferredSize(Scene.java:1478)
      at javafx.stage.Window$10.invalidated(Window.java:719)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      at javafx.stage.Window.setShowing(Window.java:782)
      at javafx.stage.Window.show(Window.java:797)
      at javafx.stage.Stage.show(Stage.java:229)
      at javafxapplication1.JavaApplication2.start(JavaApplication2.java:35)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
      at java.lang.Thread.run(Thread.java:722)

        Attachments

          Activity

            People

            Assignee:
            dgrieve David Grieve
            Reporter:
            slugovoy Sergey Lugovoy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: