开发者

Update JTable in runtime

开发者 https://www.devze.com 2023-04-09 12:28 出处:网络
I have a JTable which represents a database table. In runt开发者_如何转开发ime when I click a button I want to update my table from database. It is working if the button is in that panel where the tab

I have a JTable which represents a database table. In runt开发者_如何转开发ime when I click a button I want to update my table from database. It is working if the button is in that panel where the table is. When I try to create an object from other class it is not working.

How can I update a JTable from outside of the class in running?


Yes, you can. Just pass a reference to the TableModel to the other class. When the other class changes the TableModel, the JTable will be automatically updated.

0

精彩评论

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