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 - 在表格视图中移动列


基础教程推荐
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 从 python 访问 JVM 2022-01-01