• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable column hiding  RSS feed

 
Sandeep Lakshmipathy
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
I want to know how the JTable columns can be dynamically hidden and reshown as per user request. Please help in this regard
Thanks
Sandeep
 
Renee Zhang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember there is a similar question that has been posted before...
Just set the column.setPreferredWidth(0); and column.setMaxWidth(0); to hide the column and reset the size to show it. I use this trick in my project and it works very well.
Gook luck!
Renee
 
Sandeep Lakshmipathy
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot
I think the same will help me too
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!