JTable cell edits not calling setValueAt()

J

Javayang

I have a JTable with a cell that is currently being edited. When the
user finish editing, he switches to another view / tab without
selecting another cell or row in the table. The problem is
setValueAt() in the table model does not seem to get called unless the
user switches to another cell. So when the user come back to the
view, his data is loss or not saved. Is there a way to generate an
event to force the cell to finish editing and cause the setValueA() to
be called? Or do I have to implement a custom editor?

I've tried multiple things but none of panned out so any input would
be greatly appreciated.

Thanks in advance.

Kent
 
T

Tor Iver Wilhelmsen

Is there a way to generate an event to force the cell to finish
editing and cause the setValueA() to be called?
theTable.getCellEditor().stopCellEditing();

Or do I have to implement a custom editor?

Won't help, the editor is still posted in t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top