开发者

JTable - fire row changed when row deleted

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜