JTable edit problem

I have a JTable, with 6 columns and 2 rows that I need to fill..

If I don't press the Enter key after filling each cell, and if I click on any other component (like menu item in menubar) then the value which i have entered in the table cell is lost.

I tried using

table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

still, i find the value which i have entered in the table cell is lost.

Can anyone suggest me a way of acheiving this

[488 byte] By [murali25a] at [2007-11-27 3:03:55]
# 1

> table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

The above only works on JDK1.4 or later releases.

Prior to JDK1.4 you need to add the following in the actionPerformed() method of your button:

if ( table.isEditing() )

{

table.getCellEditor().stopCellEditing();

}

camickra at 2007-7-12 3:48:01 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thank you camickr. It works fine now.
murali25a at 2007-7-12 3:48:01 > top of Java-index,Desktop,Core GUI APIs...