Question

I want to have two checkBox like this : enter image description here

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>
Was it helpful?

Solution

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top