开发者

To refresh JTable JAVA

开发者 https://www.devze.com 2023-04-03 22:01 出处:网络
I wanted to refresh JTable immediately when data is inserted or deleted ,i got problem looked at forums but the solutions are too particular to their examples,is there a general 开发者_运维技巧way how

I wanted to refresh JTable immediately when data is inserted or deleted ,i got problem looked at forums but the solutions are too particular to their examples,is there a general 开发者_运维技巧way how JTable is refreshed on any event on same page happens? specially when the event changes data upon which the table model relies..


Updates should be done directly to the TableModel. The model will then notify the table so the table can repaint itself.

If you are using a custom TableModel, then it is your responsibility to make sure the proper fireXXX() methods inherited from the AbstractTableModel are invoked when the TableModel is changed.

Using the DefualtTableModel is an easy way to start since it does all this for you.

0

精彩评论

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

关注公众号