Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当双击 jtable 的可编辑单元格时,如下所示。
我需要的是,如果用户在输入值之前在按下按钮的表外单击鼠标,则应自动输入现有值,输出应显示如下。
任何帮助或建议将不胜感激。
对于 DefaultTableModel 默认工作myJTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
myJTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE)
覆盖stopCellEditing()
stopCellEditing()
一种)public boolean stopCellEditing()
public boolean stopCellEditing()
b)myJTable.getCellEditor().stopCellEditing();
myJTable.getCellEditor().stopCellEditing();
C)myJTable.getCellEditor(row, col).stopCellEditing();
myJTable.getCellEditor(row, col).stopCellEditing();