How do I save the last edit (make with a TableCellEditor) to a JTable when the user presses a button?

Jon Wingfield

The JTable and TableCellEditor APIs provide methods to do this. You can tell whether the table is still editing by using:


table.isEditing();

You can then decide how to terminate the edit by using one of the following methods from the TableCellEditor API:


TableCellEditor tce = table.getCellEditor();
// either
tce.stopCellEditing();
// or 
tce.cancelCellEditing();
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact