Reputation: 18531
In my system we use JTable
with data model.
when data changes we remove it from the model, iterate the model and fire for each row listElementPropertyChanged
(I think its intellij's). In this way removed lines are not deleted cause they are not in the model.
How do I refresh the whole table according to the model?
Upvotes: 1
Views: 3679
Reputation: 22300
Simply use fireTableDataChanged()
. This way, all listeners will now that all data may have changed.
However, use it with care, as usual behaviour for listeners will be to refresh the whole table.
You would have better using fireTableRowsDeleted(int, int)
with the removed rows indexes.
Upvotes: 3