我在 FXML 中有以下 GridPane:
(此代码由 JavaFX Scene Builder 生成)
<GridPane fx:id="gridUsers" alignment="TOP_CENTER" layoutX="13.0" layoutY="161.0" prefWidth="763.0">
<children>
<Label fx:id="codigoUsuarioLabel" text="Code" GridPane.columnIndex="0" GridPane.rowIndex="0">
<font>
<Font name="System Bold" size="18.0" fx:id="x2" />
</font>
</Label>
<Label fx:id="userNameLabel" font="$x2" text="Name" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label fx:id="loginUserLabel" font="$x2" text="Login" GridPane.columnIndex="2" GridPane.rowIndex="0" />
<Label fx:id="userOptionsLabel" font="$x2" text="Options" GridPane.columnIndex="3" GridPane.rowIndex="0" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="308.0" minWidth="10.0" prefWidth="102.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="482.0" minWidth="0.0" prefWidth="318.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="244.0" minWidth="10.0" prefWidth="244.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="100.0" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
在我的 UserController 中,我有一个包含 User 对象的集合。我想将此集合从 Controller 传递到 GridPane 并列出对象,最好使用分页。
我怎样才能做到这一点?