user72708
user72708

Reputation: 1255

JavaFX how to style FXML file

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>

Upvotes: 0

Views: 2075

Answers (1)

denhackl
denhackl

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

Related Questions