aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes GridBagLayout squishes components on resize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "GridBagLayout squishes components on resize" Watch "GridBagLayout squishes components on resize" New topic
Author

GridBagLayout squishes components on resize

jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Hi Guys :

Im using GridBagLayout to layout 5 components. Im not trying
to do anything fancy...
All the components being added below are scrollpanes
with Jtables inside. When I have a maximized window,
the layout is fine, but my problem is that if I resize the window, all the
components get squished together in a really small area
in the center of the screen... Any ideas ?

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
try adding (to each of your constraints)

[constraints].weightx = .5;
[constraints].weighty = .5;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GridBagLayout squishes components on resize
 
Similar Threads
GridBagLayout..Please check my code..
buttons that are not same size
how to align components in GridBagLayout in JAVA swing
How to (re)paint an AWT applet faster
How to stop JTextField collapsing when using GridBagLayout?