File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Positioning controls on a GridBagLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Positioning controls on a GridBagLayout" Watch "Positioning controls on a GridBagLayout" New topic
Author

Positioning controls on a GridBagLayout

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a GridbagLayout which has a JButton on the left and 2 JComboBoxes
on the right. How can I set the contraints so if the panel is stretched
the 2 combo boxes remain on the right of the panel?

Thanks.
Sloan Bowman
Ranch Hand

Joined: Jan 21, 2003
Posts: 107
You should create your constraints so the right hand has a higher weight. For example.

constraint = new GridBagConstrait(1,1, 1,1, 1.0, 1.0 etc...

If you post some code I'll be glad to help you out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Positioning controls on a GridBagLayout