Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JGoodies JTable Refresh  RSS feed

 
parvin asadzadeh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have designed a form using JGoodies. In my From I have a Jtable.



When the table's content changes, I have to refresh the screen to show the new table.
How can I do this?
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Swing you would add a Listener. Try the Java Tutorials.
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the table's content changes


How do you change the content? The proper way to change the content is to update the TableModel, then the TableModel will notify the JTable of the changes and the table will repaint itself


I have to refresh the screen to show the new table.


It sounds like you are creating a new JTable. Don't do this. If you update the data completely then create a new TableModel and then add the TableModel to the table using:



Again the table will repaint itself automatically.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!