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

Checkbox and RadioButton: style -fx-alignment doesn't work with invocation setPrefSize

XMLWordPrintable

      This also applies to RadioButton.

      Run this code to reproduce
      @Override
          public void start(Stage stage) throws Exception {
              StackPane root = new StackPane();
              
              final CheckBox che = new CheckBox("MinSize");
              final CheckBox che2 = new CheckBox("PrefSize");
              String style = "-fx-border-color:red;-fx-alignment:bottom-right;";
              che.setStyle(style);
              che2.setStyle(style);
              che.setMinSize(150, 150);
              che2.setPrefSize(150, 150);
              root.getChildren().add(HBoxBuilder.create().children(che, che2).spacing(20).alignment(Pos.CENTER).build());
              
              Scene scene = new Scene(root, 320, 300);
              stage.setScene(scene);
              stage.show();
              stage.setTitle(VersionInfo.getRuntimeVersion());
          }

        1. checkbox.png
          13 kB
          Sergey Lugovoy
        2. checkbox-2.2.png
          13 kB
          Sergey Lugovoy

            raginip Ragini Prasad (Inactive)
            slugovoy Sergey Lugovoy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: