开发者

Refreshing a jtable to reflect a change made to the database-JAVA MYSQL

开发者 https://www.devze.com 2023-02-10 19:16 出处:网络
H开发者_如何学编程ow do you reloada jtable after carrying out a delete or insert on DB Well, the safest way is probably to re-execute the DB query used to get the table data, then rebuild a table mode

H开发者_如何学编程ow do you reload a jtable after carrying out a delete or insert on DB


Well, the safest way is probably to re-execute the DB query used to get the table data, then rebuild a table model, and call setModel on your JTable (or pass the new data to a custom setData() method of your TableModel implementation, and call fireTableDataChanged() from this setData() method).

0

精彩评论

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