JavaFX-FXML中VBox中节点的公平分配
如何在VBox中公平分配多个分区? 换句话说,我有以下FXML代码:JavaFX-FXML中VBox中节点的公平分配,java,distribution,fxml,vbox,Java,Distribution,Fxml,Vbox,如何在VBox中公平分配多个分区? 换句话说,我有以下FXML代码: <Tab text="SOO properties"> <content> <VBox> <HBox> <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name" /> <TextField /&g
<Tab text="SOO properties">
<content>
<VBox>
<HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name" />
<TextField />
</HBox>
<HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Number of MobileEntity slots" />
<TextField />
</HBox>
<HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="MobileEntity buffer size" />
<TextField />
</HBox>
<HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Connections number" />
<TextField />
</HBox>
<HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Peripherals number" />
<TextField />
</HBox>
</VBox>
</content>
</Tab>
该产品符合以下观点:
我怎样才能得到那样的东西
根据GoXr3Plus,GridPane适用于这种情况:
<Tab text="SOO properties">
<GridPane prefHeight="230.0" prefWidth="358.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<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>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Name" />
<TextField GridPane.columnIndex="1" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Number of MobileEntity slots" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="MobileEntity buffer size" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Connections number" GridPane.rowIndex="3" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Peripherals number" GridPane.rowIndex="4" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="4" />
</children>
</GridPane>
</Tab>
生成此视图:
您可以使用javafx gridpane和voilla!也看看谢谢,它工作得很好!请从您的问题中删除您的答案,创建新答案并接受它。。。或者让给你答案的人写一个真实的答案。目前的状态是。。。搞错了。我必须等两天才能把我的答案标记为解决方案。