• Post Reply Bookmark Topic Watch Topic
  • New Topic

Resetting columns in JTable  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable in a JScrollPane that is in a singleton class. Can anyone tell how to clear the data in the JTable each time the class is invoked? The table retains the column names that it had on the first call to the class.
Thanks,
Barry
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to do it via modifications in the table model. I believe, you are using some table model. We can help more if you can elaborate a bit more or post some code here.
HTH,
- Manish
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way is to call setHeaderValue() on every Column in the JTable.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!