• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refreshing JTable trouble

 
Chris Ogden
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTabe which reads from an access database using a seperate class ResultSetTableModel.Once I add, delete or update a record the changes occur but the table doesn't reflect the changes.I created a seperate button to re-establish the query.the problem is that I don't want to have to click the button everytime I manipulate the DB.
I even call the button.doClick() function after an update,add or delete function, but nothing actually happens.I HAVE to click the button physically.
Please help ME
 
Claudio Gualberto
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you'd posted the code it would be easer to help you, but let's go.
What you want is to update the data in the JTable component , right ? that's what it seems.
You're serving the JTable through the class ResultSetTableModel that probably extends AbstractTableModel. If all that it's true, when you update the DB you must call the method fireTableDataChanged() from AbstractTableModel, that tells the JTable it must update it's rows.
It might resolve your problem, but if it doesnt, post the source code here and i gonna try again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic