Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting, Editing, deleting rows in JTable

 
sri rallapalli
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Justin Chu
Ranch Hand
Posts: 209
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have updated the database, but you'll also need to either recreate the table with new data, or update the table's model.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic