简体   繁体   English

如何实现TreeTableView控件的列标题跨越功能?

[英]How to implement a column headers spanning feature of TreeTableView control?

In the picture below ( source ) Balance column span Income and Spending columns. 在下面的图片中( 来源 ),“ Balance列跨越“ Income和“ Spending列。 I can't found any information of how to achieve this... 我找不到有关如何实现此目标的任何信息...

Any help appreciated 任何帮助表示赞赏

在此处输入图片说明

This feature (nested columns) is documented in the Oracle JavaFX controls tutorials for TableView . TableViewOracle JavaFX控件教程中记录了此功能(嵌套列)。

For example, suppose that the contacts in the address book have two email accounts. 例如,假设通讯录中的联系人有两个电子邮件帐户。 Then you need two columns to show the primary and the secondary email addresses. 然后,您需要两列来显示主要和辅助电子邮件地址。 Create two subcolumns, and call the getColumns method on emailCol. 创建两个子列,然后在emailCol上调用getColumns方法。

 TableColumn firstEmailCol = new TableColumn("Primary"); TableColumn secondEmailCol = new TableColumn("Secondary"); emailCol.getColumns().addAll(firstEmailCol, secondEmailCol); 

嵌套列

Read the nested columns javadoc ( TableColumnBase.getColumns ) for more information. 阅读嵌套列javadoc( TableColumnBase.getColumns ),以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM