Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Vertical Fill

 
Andrew Cho
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

Does anyone know how to make a JTable fill a container vertically? I don't want to hard code the row size since my GUI needs to be resizable at runtime.

Thanks,
Andrew
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends what you mean by 'fill'. There's setFillsViewportHeight, but if what you want is to adjust the row height you could override getRowHeight() to return getParent().getHeight() / getRowCount().
 
Andrew Cho
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow that second part was exactly what I was looking for. It works perfectly .

Thank you so much,
Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic