Forums Register Login

Inserting, Editing, deleting rows in JTable

+Pie Number of slices to send: Send
Hi All,

I am new to swings, and i am working on a swing application. I have developed some screens, in 1st screen i am showing the rows in the JTable, and i have 3 buttons Add,Edit,Delete.
For all the 3 actions(Add,Edit,Delete)
I will select a row in the Table, and then click the Button.

1. When i click the Add button, It will open another window with the existing values as default values, to take the new values and then if click ok, then it will be going to add a new Row to the table.

2. When i click edit button, It will open another window with the existing values as default values, to take the new values and then if click ok, then it will be going to change the Row that was selected and update to the table.

3. When i click the Delete button, it will delete the row, abd refresh the table.
In all the 3 operations, it will update the Database.
I am writing seperate classes for the 3 operations, and I am writing a seperate class for the Table to display its values.

Now the problem is, it is not refreshing the table contents when i do the operation, but when i close everything, and reopen freshly, i am able to see the content correctly. I want to see the Changes immediately after i do the operations.

Please help me. This is urgent.

Regards,
Srinivas.
+Pie Number of slices to send: Send
You have updated the database, but you'll also need to either recreate the table with new data, or update the table's model.
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 4119 times.
Similar Threads
adding a JCheckBox in a JTable
jtable
JTable problem
MultiComponent JTable
model.removeRow() from JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:13:56.