【发布时间】:2018-08-12 00:45:50
【问题描述】:
如果有人问过这个问题,但我的搜索没有成功,我深表歉意。
给定两个在 JavaFX 中列数和类型相同的表,例如:
// First Table
private TableView table1 = new TableView();
TableColumn col11 = new TableColumn("col1");
TableColumn col12 = new TableColumn("col2");
table1.getColumns().addAll(col11, col12);
// Second Table
private TableView table2 = new TableView();
TableColumn col21 = new TableColumn("col1");
TableColumn col22 = new TableColumn("col2");
table2.getColumns().addAll(col21, col22);
[... logic adding and showing tables here ...]
如何绑定col11 和col21 以及col21 和col22 之间的排序属性,这样,当我单击table1 中的列标题时(使排序箭头出现),table2 将根据该列的条件进行排序。
【问题讨论】:
标签: java sorting javafx tableview tablecolumn