开发者

JTable - fire row changed when row deleted

开发者 https://www.devze.com 2023-02-24 06:51 出处:网络
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 re

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消