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 (Graphic User Interface) 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 | ![]() Oracle’s Javadoc on BorderLayout class : available:
|
BoxLayout | ![]() Oracle’s Javadoc on BoxLayout class : available:
|
CardLayout | ![]() Oracle’s Javadoc on CardLayout class : available:
|
DesignGridLayout | ![]() |
EasyLayout | ![]() |
ExplicitLayout | Allows non-rectangular layouts. By Zooki Technology. |
FillLayout | SWT (Standard Widget Toolkit). lays out equal-sized widgets in a single row or column. |
FlowLayout | ![]() Oracle’s Javadoc on FlowLayout class : available:
|
FormLayout | Karsten Lentzsch’s free, open source LayoutManager. Karsten is the Leonardo da Vinci of layout designers. His layouts get every last picky detail correct, including working with larger-than-expected fonts. Even if you don’t use his layouts, read what he has to say about GUI design. version 1.2 is coming soon which has layout variables for meta design constants. Last revised/verified: 2008-04-04 For example, 85dlu for all label column widths, 100dlu for the minimum table height, etc. See scalable layouts for a discussion of the problem of scaling layouts. |
GridBagLayout | ![]() |
GridLayout | ![]() Oracle’s Javadoc on 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 (Java Development Kit). 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: aka Gui Builder | 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 positional parameters. Not to be confused with PackerLayout. |
PackerLayout | A Java version of the Tcl/Tk layout manager. Some of the GridBag pad/expand abilities. |
RowLayout | SWT. lays out widgets in a row or rows, with fill, wrap and spacing options. |
fuin.org ScalableLayout | Zoom the Swing UI (User Interface) (like CTRL+/CTRL- in Firefox for web pages) |
SpringLayout | ![]() Oracle’s Javadoc on 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. |
XYLayout | Borland absolute position layout. |
NetBeans and JBuilder have GUI layout builders. Radical is a stand-alone GUI Builder.
![]() ![]() |
This page is posted |
http://mindprod.com/jgloss/layout.html |
Optional Replicator mirror
|
J:\mindprod\jgloss\layout.html | |
![]() |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | |
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[18.222.219.97] |
| |
Feedback |
You are visitor number | |