Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to refresh JTable

 
Allen Chan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
When peforming a search, I guess I should use JTable to show the result, but how do I refresh it?
Thanks in advance.
 
ravindra janapreddy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Allen
You can refresh the JTable as follows :
table.repaint();
Ravindra
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should send new data to table model, using a method defined in table model. Something like this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic