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

有帮助吗?

解决方案

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

Looks like your changes skips events firing.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top