删除对可编辑jtable单元格的关注
问题描述:
双击jtable的可编辑单元格时,如此处显示。
When double click on editable cell of jtable it shown as here.
我需要的是如果用户在输入值之前按下鼠标在按钮之外,则应自动输入现有值,输出应显示如下。
what i need is if user click mouse outside table of press a button before entering the value then existing value should be auto entered and output should be shown as follow.
任何帮助或建议将不胜感激。
Any help or suggestion would be greatly appreciated.
答
-
对于DefaultTableModel默认工作
myJTable.putClientProperty(terminateEditOnFocusLost,Boolean.TRUE)
;
覆盖 stopCellEditing()
a) public boolean stopCellEditing()
b) myJTable.getCellEditor()。stopCellEditing();
c) myJTable.getCellEditor(row,col).stopCellEditing();