开发者

To refresh JTable JAVA

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜