JavaFX - move columns in tableview(JavaFX - 在表格视图中移动列)
问题描述
在 (JavaFX) 表格视图中,您可以自动移动列(更改列的顺序).
但这不会存储在列表中.
In (JavaFX) a tableview, you can automatically move columns(change the order of the columns).
But this will not store in the List.
那么我该如何保存它,或者有没有更好的方法来移动列并将其保存在 DataList 中?
So how can I save it, or is there any better way to move columns and save it in the DataList?
推荐答案
但这不会存储在列表中.
But this will not store in the List.
不,tablecolumn 的顺序将存储在 tableView.getColumns()
可观察列表中.请参考 javadoc.通过遍历这个列表,您可以持久化表格列的 id
,并在下次应用启动时恢复它们.或者您可以开发其他方法来持久化表格列顺序.
No, the tablecolumn order will be stored in tableView.getColumns()
observable list. Please refer to javadoc. By traversing this list you can persist the id
s of tablecolumns, and restore them on next app start. Or you may develop other ways of persisting the tablecolumn order.
这篇关于JavaFX - 在表格视图中移动列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JavaFX - 在表格视图中移动列


- 如何指定 CORS 的响应标头? 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 获取数字的最后一位 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 转换 ldap 日期 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01