Search code examples
javaswingjtabledefaulttablemodel

JTable and DefautlTableModel not refreshing


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);


Solution

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

    Looks like your changes skips events firing.