refresh j table

i have a jtable in which three textfield r also there and a button to save when i click save the data from textfield goto database and then i retrieve data to jtable.. but it is not coming at the same time when i clicked save.

when i close frame and again oen that time i can see data in it.

how to refresh it on save button.

[344 byte] By [sudh_friendsforevera] at [2007-11-27 3:26:13]
# 1

Well, your save button needs to do two things:

a) update the database (apparently this works)

b) update the TableModel (apparently this isn't working).

Well, you just use the DefaultTableModel.setValueAt(...) method to update existing cells in the table.

Or if you are adding a new row to the table, then you need to use the DefaultTableModel.addRow(...) method.

camickra at 2007-7-12 8:28:57 > top of Java-index,Desktop,Core GUI APIs...