Two Laptop Bag*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 2246

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.

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
It is sorta covered in the JavaRanch Style Guide.
subject: Help suggest a proper layout manager for my form
Similar Threads
Weird JSplitPane behaviour on frame resize (bug?)
500: SERVER ERROR [AS - 00-0002]
How to create a flexible window?
newbie multiple frames problem
500: SERVER ERROR [AS - 00-0002]