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 ids of tablecolumns, and restore them on next app start. Or you may develop other ways of persisting the tablecolumn order.
这篇关于JavaFX - 在表格视图中移动列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JavaFX - 在表格视图中移动列
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
