JavaFX 2 TableView 直接在控件上插入行

发布于 2025-01-01 13:33:54 字数 139 浏览 3 评论 0原文

JavaFX 2 中的 TableView 控件是否允许在控件的单元格上插入新数据?

我在那个方向找不到任何东西。甚至 Oracle 示例在控件之外也有单独的文本框和 ADD 按钮(就像 90 年代初一样 - 是的,我已经编程了那么久......)

Does the TableView Control in JavaFX 2 allow the insertion of new data right on the cells of the control?

I have not been able to find anything in that direction. Even the Oracle sample has separate textboxes and an ADD button outside of the control (like it was in the early 90's - yea, I've been programming for that long...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红玫瑰 2025-01-08 13:33:54

目前尚不清楚您想要实现什么目标。

如果您的意思是就地编辑表值,您可以查看本教程: http://docs.oracle.com/javafx/2.0/ui_controls/table-view.htm

如果您想通过单元格上的操作添加新行,您可以通过以下方式向单元格添加上下文菜单TableView.setContextMenu(context_menu); 并实现“在单元格右侧”添加新行。

It's not really clear what do you want to achieve.

If you mean editing table values in place you can take a look at this tutorial: http://docs.oracle.com/javafx/2.0/ui_controls/table-view.htm

If you want to add new row by action on cell you can add context menu to cells by TableView.setContextMenu(context_menu); and implement adding new row "right on the cells".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文