It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes can you resize a JTable from UI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "can you resize a JTable from UI?" Watch "can you resize a JTable from UI?" New topic

can you resize a JTable from UI?

Kate Zoy
Ranch Hand

Joined: Feb 11, 2004
Posts: 33
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?
Norm Miller
Ranch Hand

Joined: May 21, 2002
Posts: 56
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.
I agree. Here's the link:
subject: can you resize a JTable from UI?
jQuery in Action, 3rd edition