SWING JTable,单元格开始编辑事件 [英] SWING JTable, cell start to edit event
本文介绍了SWING JTable,单元格开始编辑事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个JTable,它的这些单元格是可编辑的,有任何方法可以处理单元格开始编辑"事件,以便在用户开始编辑单元格时可以显示一条消息.
I have a JTable and these cells of it are editable, there are any ways to handle the "cell start to edit" event in order that I can display a message when users start to edit a cell.
推荐答案
如果这是我的代码,我将首先尝试重写TableEditor的getTableCellEditorComponent
方法.在覆盖内部,我将调用要在编辑开始时调用的方法,然后在覆盖内部调用父级的getTableCellEditorComponent
方法.
If this were my code, I'd start by trying to override the TableEditor's getTableCellEditorComponent
method. Inside of the override, I'd call the method that I want to call when editing starts, and then I'd call the super's getTableCellEditorComponent
method inside the override.
您可以在 查看全文