JavaFX - 在表格视图中移动列 [英] JavaFX - move columns in tableview

查看:41
本文介绍了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 - 在表格视图中移动列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆