java swing,模拟JTable终止EditOnFocusLost行为
putClientProperty("terminateEditOnFocusLost", Boolean);
当 jtable 失去焦点或简单地单击其他 GUI 组件时,它会结束编辑并清除当前选定的行。 这非常有用,但是对于“terminateEditOnFocusLost”,如果将其与 editCellAt 和 changeSelection 一起使用,则会出现一些奇怪的行为。
还有一些不良的 TableModelEvents 因一些虚假的表更新而被触发。
所以,我正在寻找一种黑客来模拟“terminateEditOnFocusLost”而不使用它,这可能吗?
谢谢大家。
putClientProperty("terminateEditOnFocusLost", Boolean);
to make jtable end editing and clear current selected rows when it lose focus or when simply click over an other GUI component.
This is very useful, but with "terminateEditOnFocusLost" there are some strange behaviours if it is used with editCellAt and changeSelection.
There are also some undesiderable TableModelEvents fired for some fake table updates.
So, im looking for an hack to simulate "terminateEditOnFocusLost without using it, is this possibile?
Thanks all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前没有黑客攻击。
putClientProperty("terminateEditOnFocusLost", Boolean) 似乎是唯一正确的方法。
No hack at this moment.
putClientProperty("terminateEditOnFocusLost", Boolean) seem to be the only correct way.
重载该函数以使其满足您的需求。
Overload the function to make it suit your needs.