Reputation: 1255
I want to have two checkBox like this :
but with this FXML I have two checkBox in the same line.
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="application.EX1Controller">
<center>
<HBox>
<padding>
<Insets top="25" left="25"/>
</padding>
<ImageView id="currentFrame" />
</HBox>
</center>
<right>
<HBox alignment="CENTER_LEFT">
<CheckBox fx:id="checkbox_one" mnemonicParsing="false" text="Show B" onAction="#Gray" />
<CheckBox fx:id="checkbox_two" mnemonicParsing="false" text="Show A"/>
</HBox>
</right>
</BorderPane>
Upvotes: 0
Views: 2075
Reputation: 1115
Use the class VBox
for vertical aligned nodes.
<VBox alignment="CENTER_LEFT">
<CheckBox fx:id="checkbox_one" mnemonicParsing="false" text="Show B" onAction="#Gray" />
<CheckBox fx:id="checkbox_two" mnemonicParsing="false" text="Show A"/>
</VBox>
Upvotes: 2