Originally posted by Vinod Venugopal:
Hi,
I have a JTable with model extended from DefaultTableModel. The table is in a frame with a Save button. If a cell is edited & when I click on Save , the new cell values should be obtained.Im not able to get the updated values on Save. Im storing the selected row in a vector. Any suggestions pls.
Vinod
Hi Vinod
in the action performed method of the button, u can write
.
.
table.getCellEditor().stopCellEditing();
.
.
this works well..
i hope u have Overridden
setValueAt(..)
method from AbstractTableModel or DefaultTableModel class.
getCellEditor returns and instance of DefaultCellEditor if u have not subclassed any CellEditor, if so cast it to the corresponding CellEditor..
Try out if not mail me i will mail u the code.
Good Luck
George Justin