| Components in the Layout | Table of Possible Layout Managers |
| What Layout Managers Do | Gotchas |
| Null Layouts | Learning More |
| Nested Containers | Links |
These methods often return 0,0 as the size. The reason is, they rely on the underlying GUI to compute the size, and if there in no peer object yet, there is no hook to ask the native GUI. See addNotify.
You should almost never use null layouts and setLocation. This is a last ditch emergency method when all layout managers have failed to give you decent positioning and it would be impossible to write a layout manager with enough common sense.
When you do use manual layout you must do several things:
| Possible Layout Managers | |
|---|---|
| Layout | Purpose |
| AbsoluteLayout | Netbeans absolute position layout. |
| BorderLayout |
Sun’s Javadoc on the BorderLayout class : available:
|
| BoxLayout |
Sun’s Javadoc on the BoxLayout class : available:
|
| CardLayout |
Sun’s Javadoc on the CardLayout class : available:
|
| DesignGridLayout | |
| EasyLayout | |
| ExplicitLayout | |
| FillLayout | SWT. lays out equal-sized widgets in a single row or column. |
| FlowLayout |
Sun’s Javadoc on the FlowLayout class : available:
|
| FormLayout |
|
| GridBagLayout |
|
| GridLayout |
Sun’s Javadoc on the GridLayout class : available:
|
| GridLayout SWT | SWT. lays out widgets in a grid FormLayout |
| GroupLayout | Part of Netbeans/Matisse. It is not bundled with the JDK. It backs up the visual layout abilities of Matisse. |
| HIGLayout | Similar to TableLayout, by Daniel Michelik |
| JTabbedPane | JTabbedPane is a JComponent, not a LayoutManager, but it behaves much like a CardLayout with tabs. |
| JSplitPane | JSplitPane is a JComponent, not a Layout, but it behaves much like one with two panels and a moveable boundary between them. |
| LabeledGridBagLayout | Like a GridBagLayout that automatically labels fields with their corresponding field names. Requires use of smart components that know their field labels. Part of the com.mindprod.business package. |
| Matisse | A new NetBeans scheme for building layouts interactively with a backing set of layout managers. It is still in alpha test. |
| MigLayout | Free. Intended to be a universal layout manager for all possible applications. This is RedGrittyBrick’s favourite layout manager. Has tools for writing resolution-independent code. |
| Packer | A front end to the GridBagLayout using a fluent interface to cut down the number of postitional parameters. Not to be confused with PackerLayout. |
| PackerLayout | A Java version of the Tcl/Tk layout manager. Some of the GridBag pad/expand abilities. |
| RainLayout | Orders components according to a Comparator. |
| RiverLayout | It mimics how text is positioned in a text editor, where the words words flow from left to right. They are normally separated with spaces, but if you want them aligned in columns you can use tab stops. You can insert line breaks where needed and even paragraph breaks to separate sections of text. |
| RowLayout | SWT. lays out widgets in a row or rows, with fill, wrap, and spacing options. |
| SpringLayout |
Sun’s Javadoc on the SpringLayout class : available:
|
| StarLayout | Arranges objects in star shaped patterns. You place components by giving the angle and radius from the centre of the container. |
| TableLayout | A simplified GridBagLayout. You explicitly control the relative sizes of each row and column. By Daniel Barbalace and the ClearThought TableLayout Project. |
| ToolBarLayout | designed for use as LayoutManager for tool bar’s dock container. Its usage is very simple — all you need to provide is a Point object as constraint. |
| XYLayout | Borland absolute position layout. |
NetBeans and JBuilder have GUI layout builders. Radical is a stand-alone GUI Builder.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.61] | ![]() | ||
| You are visitor number 36,851. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/layout.html | J:\mindprod\jgloss\layout.html | ||