Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can you resize a JTable from UI?

 
Kate Zoy
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JFrame containing a JTable. When the program is running, I can resize the JFrame by clicking an end corner and dragging. I want to be able to do that with my JTable too... is that possible?
Thanks!!
 
Norm Miller
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Place a panel in the center of the Frame (Using the default BorderLayout).
Set the layout of the panel to Grid Layout.
Place your scrollbar(if any) there.
The table then goes on the scrollbar (or directly on the panel).
The grid seems to re-size the nicest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic