1
我在JavaFX中製作應用程序。我使用Scene Builder,但是我的GridPane出現問題。 你能告訴我爲什麼我的GridPane不會長到正確的位置嗎?javaFX場景構建器。 APP不響應,不會增長到右側
這是我的應用程序的屏幕。 Screen of my app
和FXML文件:
<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>
您的代碼正在按照預期工作在JavaFX 8上。檢查您的JavaFX運行時間。 –