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

ClassCastException from impl_cssSet when trying to style prefColumns or prefRows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7-pool
    • Fix Version/s: fx2.0.2
    • Component/s: javafx
    • Labels:

      Description

      WARNING: javafx.scene.Node impl_cssSet Failed to set css [StyleableProperty {owningClass: javafx.scene.layout.TilePane, fieldName: prefColumns, property: -fx-pref-columns, converter: SizeConverter, initialValue: '5', inherits: false, subProperties: []}]

      java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
              at javafx.scene.layout.TilePane.impl_cssSet(TilePane.java:930)


      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.TilePane;
      import javafx.stage.Stage;

      public class Main extends Application {

          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override public void start(Stage stage) throws Exception {

              TilePane tilePane = new TilePane();
              tilePane.setStyle("-fx-pref-columns: 3; -fx-pref-rows: 2;");

              Button btns[] = new Button[6];
              for (int i=0; i<6; i++) {
                  btns[i] = new Button(Integer.toString(i));
                  btns[i].setStyle("-fx-padding: 20;");
                  tilePane.getChildren().add(btns[i]);
              }

              stage.setScene(new Scene(tilePane));
              stage.show();
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              dgrieve David Grieve (Inactive)
              Reporter:
              dgrieve David Grieve (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: