• Post Reply Bookmark Topic Watch Topic
  • New Topic

preferred Size of TableColumn  RSS feed

 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to what I read, the TableColumn objects of a JTable have a default preferred size of 75. That seems to be the case no matter what is in the table's cells. What I want to do is make the preferred size to change automatically depending on what is in the cells. Specifically, when one cell in a column has a long String in it, I want the preferred size of the whole column to change size to be wide enough to display the String.
Anyone know how to do that?
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Table Column Adjuster may provide a few different options.
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I looked at the example code carefully and adjusted it to my particular program.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!