Вопрос

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