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 line开发者_如何学Cs are not deleted cause they are not in the model.
How do I refresh the whole table according to the model?
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.
精彩评论