• 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:
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!