1

I make an app in JavaFX. I use Scene Builder but I have problem with my GridPane. Could you tell me why my GridPane doesn't grow to the right ?

Here is the screen od my app. Screen of my app

and the FXML file:

<BorderPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8">
   <center>
      <HBox maxWidth="1.7976931348623157E308" minWidth="500.0" BorderPane.alignment="CENTER">
         <children>
            <Separator orientation="VERTICAL" prefHeight="200.0" HBox.hgrow="ALWAYS" />
            <VBox BorderPane.alignment="CENTER" HBox.hgrow="ALWAYS">
               <children>
                  <GridPane VBox.vgrow="ALWAYS">
                    <columnConstraints>
                      <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                      <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
                    </columnConstraints>
                    <rowConstraints>
                      <RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                      <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                        <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                    </rowConstraints>
                     <children>
                        <Label text="Label" />
                        <Label text="Label" GridPane.rowIndex="1" />
                        <Label text="Label" GridPane.rowIndex="2" />
                        <Label text="Label" GridPane.rowIndex="3" />
                        <Label text="Label" GridPane.rowIndex="4" />
                        <Label text="Label" GridPane.rowIndex="5" />
                        <TextArea prefHeight="85.0" prefWidth="150.0" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="5" GridPane.vgrow="ALWAYS" />
                        <TextField GridPane.columnIndex="1" />
                        <Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
                        <Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
                        <Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
                        <Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" />
                     </children>
                     <VBox.margin>
                        <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
                     </VBox.margin>
                  </GridPane>
               </children>
            </VBox>
         </children>
      </HBox>
   </center>
</BorderPane>
Paweł Stanecki
  • 454
  • 2
  • 10
  • 24

1 Answers1

0

In scene builder you have the possibility to say "fit to parent" to your pane. Have you tried that out? You could also check the layout settings in scene builder what anchor pane constraints are set.

7twenty7
  • 558
  • 1
  • 3
  • 16