This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Help suggest a proper layout manager for my form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help suggest a proper layout manager for my form" Watch "Help suggest a proper layout manager for my form" New topic

Help suggest a proper layout manager for my form

Kurt Harless

Joined: Feb 25, 2009
Posts: 8

Ok I have experimented with BORDERLAYOUT, GRIDBAGLAYOUT, and BOXLAYOUT and can't get a mental grip on the proper layout or layouts to use to create a form with the following components;

See attached desired look.

Not looking for someone to code it, just get me started.

My Guess would be some outer layout manager that splits the frame in half vertically.
The upper half would then be a layout manager that splits the frame horizontally, approximately 2/3 and 1/3
The lower half would be a layout manager that again splits the frame vertically, but not the upper half is 90% and the lower half is 10%

Does that make sense?

Any suggested approaches?


[Download LAYOUT1.bmp] Download

K. Tsang

Joined: Sep 13, 2007
Posts: 2985

Hi Kurt, it looks to me you have a heck of an app coming.

Anyway if I were you, I would use BorderLayout for the main window. 2 JPanels (top and bottom) and set them to BorderLayout.NORTH or CENTER and BorderLayout.SOUTH.

From there ... top JPanel layout to BorderLayout - table CENTER, radio EAST. Bottom JPanel BorderLayout CENTER and SOUTH.

You see BorderLayout can do it all HAHA. Now how the JPanels interact also have some impact on the layout. Hope this helps.

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
might be a lot easier using JSplitPanes.

you can remove the dividers, and set it up so that on any (frame) resize the proportions remain the same
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Help suggest a proper layout manager for my form
It's not a secret anymore!