Programmatically stop cell editing in JTable

JTable has methods that allow to start cell editing programmatically, but no methods to stop it. My users have a problem with this, as they forget to press return before they change views, and still expect their changes to be saved. How do I programmatically stop cell editing?
[284 byte] By [Hanshina] at [2007-11-26 21:54:22]
# 1
You can find this method in javax.swing.CellEditor - stopCellEditing or cancelCellEditing. Example:JTable t;CellEditor editor = t.getCellEditor()if (editor != null) { //now someone edit somethingeditor.stopCellEditing();}
sklimenkoa at 2007-7-10 3:49:10 > top of Java-index,Desktop,Core GUI APIs...
# 2
After creating the table add the following:table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
camickra at 2007-7-10 3:49:10 > top of Java-index,Desktop,Core GUI APIs...
# 3
Many thanks for your replies! You really helped me out.
Hanshina at 2007-7-10 3:49:10 > top of Java-index,Desktop,Core GUI APIs...