-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9
-
8.0b83
Run the code :
@Override
public void start(Stage stage) throws Exception {
RadioButton b1 = new RadioButton("Text");
b1.setGraphic(new Rectangle(10, 10));
b1.setStyle("-fx-border-color: BLACK;");
b1.setAlignment(Pos.CENTER_RIGHT);
b1.setPrefSize(150, 60);
CheckBox b2 = new CheckBox("Text");
b2.setGraphic(new Rectangle(10, 10));
b2.setStyle("-fx-border-color: BLACK;");
b2.setAlignment(Pos.CENTER_RIGHT);
b2.setPrefSize(150, 60);
VBox pane = new VBox();
pane.getChildren().addAll(b1, b2);
pane.setMinSize(200, 200);
pane.setAlignment(Pos.CENTER);
stage.setScene(new Scene(pane));
stage.show();
}
Command setAlignment is ignored for radioButton and CheckBox.
(it is not ignored for other labeled controls, as I saw)
If you change setPrefSize() on setMinSize(), then it will work.
@Override
public void start(Stage stage) throws Exception {
RadioButton b1 = new RadioButton("Text");
b1.setGraphic(new Rectangle(10, 10));
b1.setStyle("-fx-border-color: BLACK;");
b1.setAlignment(Pos.CENTER_RIGHT);
b1.setPrefSize(150, 60);
CheckBox b2 = new CheckBox("Text");
b2.setGraphic(new Rectangle(10, 10));
b2.setStyle("-fx-border-color: BLACK;");
b2.setAlignment(Pos.CENTER_RIGHT);
b2.setPrefSize(150, 60);
VBox pane = new VBox();
pane.getChildren().addAll(b1, b2);
pane.setMinSize(200, 200);
pane.setAlignment(Pos.CENTER);
stage.setScene(new Scene(pane));
stage.show();
}
Command setAlignment is ignored for radioButton and CheckBox.
(it is not ignored for other labeled controls, as I saw)
If you change setPrefSize() on setMinSize(), then it will work.
- relates to
-
JDK-8095677 [Alignment] Alignment do not work in CheckBox and RadioButton
- Closed