• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inserting, Editing, deleting rows in JTable

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic