如何在 fxml 文件中定义 JavaFX 中的嵌套列?
How to define nested columns in JavaFX within the fxml file?
我想使用 fxml 生成以下 table:
所以,我想知道如何将主要列和次要列嵌套在电子邮件地址中?
在检查了这个 link 中的一些代码后,我弄明白了。
<TableView fx:id="tableView" GridPane.columnIndex="0" GridPane.rowIndex="1">
<columns>
<TableColumn fx:id="firstNameColumn" text="First Name" prefWidth="100"/>
<TableColumn text="Last Name" prefWidth="100"/>
<TableColumn text="Email Address" prefWidth="300">
<columns>
<TableColumn text ="Primary" prefWidth="150"/>
<TableColumn text ="Secondary" prefWidth="150"/>
</columns>
</TableColumn>
</columns>
</TableView>
我想使用 fxml 生成以下 table:
所以,我想知道如何将主要列和次要列嵌套在电子邮件地址中?
在检查了这个 link 中的一些代码后,我弄明白了。
<TableView fx:id="tableView" GridPane.columnIndex="0" GridPane.rowIndex="1">
<columns>
<TableColumn fx:id="firstNameColumn" text="First Name" prefWidth="100"/>
<TableColumn text="Last Name" prefWidth="100"/>
<TableColumn text="Email Address" prefWidth="300">
<columns>
<TableColumn text ="Primary" prefWidth="150"/>
<TableColumn text ="Secondary" prefWidth="150"/>
</columns>
</TableColumn>
</columns>
</TableView>