TerminateEditOnFocusLost

TerminateEditOnFocusLost

本文介绍了java swing,模拟JTable TerminateEditOnFocusLost行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

putClientProperty("terminateEditOnFocusLost", Boolean);

进行jtable结束编辑,并在失去焦点时或在其他GUI组件上单击时清除当前选定的行.这非常有用,但是如果将其与editCellAt和changeSelection一起使用,则使用"terminateEditOnFocusLost"会有一些奇怪的行为.

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.

还有一些令人讨厌的TableModelEvents会触发一些虚假的表更新.

There are also some undesiderable TableModelEvents fired for some fake table updates.

因此,我正在寻找一种无需使用它即可模拟"terminateEditOnFocusLost"的黑客,这可能吗?

So, im looking for an hack to simulate "terminateEditOnFocusLost without using it, is this possibile?

谢谢.

推荐答案

目前尚无破解方法.putClientProperty("terminateEditOnFocusLost",布尔值)似乎是唯一正确的方法.

No hack at this moment.putClientProperty("terminateEditOnFocusLost", Boolean) seem to be the only correct way.

这篇关于java swing,模拟JTable TerminateEditOnFocusLost行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 04:08