Question

MyTableModel extends DefaultTableModel, everything looks and works correctly.

I have one editable column, and the setValueAt() is being called, and the database updated.

However the table itself is not being refreshed ?

I override, getColumName(), getRowCount(), isCellEditable(), getColumClass(), and setValueAt() - which gets called, and fires the database update. The model is backed by a list, which is updated in setValueAt().

And the model is set simply by myTable.setModel(myTableModel);

Was it helpful?

Solution

Do you call super.setValueAt() in your code?

Looks like your changes skips events firing.

OTHER TIPS

Call fireTableCellUpdated() at the end of setValueAt() method. It must help you.

Maybe you need to refresh the cache of the TableModel. In order to do it you can override fireTableDataChanged() and call the super method at the end of the overriding.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top