如何禁用tableView中表列的重新排序? [英] How to disable the reordering of table columns in tableView?
本文介绍了如何禁用tableView中表列的重新排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
试图弄清楚如何在Javafx 2中禁用表列的重新排序?
Trying to figure out on how can i disable the reordering of table columns in javafx 2?
推荐答案
以下是解决方法:
tblView.getColumns().addListener(new ListChangeListener() {
@Override
public void onChanged(Change change) {
change.next();
if(change.wasReplaced()) {
tblView.getColumns().clear();
tblView.getColumns().addAll(column1,column2...);
}
}
});
这篇关于如何禁用tableView中表列的重新排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文