Take the 2-minute tour ×

I have problems in understanding how CellEditors work in Java.

I have a JTable with a model (extends AbstractTableModel). The JTable has its CellRenderer and CellEditor. The CellEditor only overrides isCellEditable() (one condition added).

How do the changes I made in one Cell go to the Model? Does the Model has to implement an CellEditorListener and react on stopEditing()?

I have read, that the changes would automatically be stored in the model. Is that true? If yes, how does it work? Do I have to react on tableChanged() then?

Please explain the way of the data, which have changed and at which steps I have to do something.

Thanks a lot!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

The changes are applied to the model via the TableModel's .setValueAt() method. The JTable itself takes care of receiving the value returned by the CellEditor and passing it to the TableModel.

share|improve this answer
Thanks! setValueAt() is called. That helps a lot. –  user1894572 Mar 2 '13 at 21:03

Your Answer


