日期:2014-05-20 浏览次数:20913 次
int editingRow = table.getSelectedRow();
if(editingRow!=-1){
TableCellEditor cellEditor = table.getCellEditor(editingRow,column_index);
cellEditor.stopCellEditing();
}
------解决方案--------------------
假设jtable是你的表格对象。
在取值直前加下面的代码:
TableCellEditor cellEditor = jtable.getCellEditor();
if(cellEditor != null ){
cellEditor.stopCellEditing();
}