Top Description Methods
java.awt

public Interface LayoutManager

Known Direct Subinterfaces
java.awt.LayoutManager2
Known Direct Implementers
javax.swing.JSpinner.DefaultEditor, javax.swing.ScrollPaneLayout, javax.swing.ViewportLayout, javax.swing.colorchooser.CenterLayout, javax.swing.colorchooser.SmartGridLayout, javax.swing.plaf.basic.BasicComboBoxUI.ComboBoxLayoutManager, javax.swing.plaf.basic.BasicComboBoxUI.Handler, javax.swing.plaf.basic.BasicInternalFrameTitlePane.Handler, javax.swing.plaf.basic.BasicInternalFrameTitlePane.TitlePaneLayout, javax.swing.plaf.basic.BasicInternalFrameUI.InternalFrameLayout, javax.swing.plaf.basic.BasicInternalFrameUI.Handler, javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout, javax.swing.plaf.basic.BasicScrollBarUI, javax.swing.plaf.basic.BasicSpinnerUI.Handler, javax.swing.plaf.basic.BasicSplitPaneDivider.DividerLayout, javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout, javax.swing.plaf.basic.CenterLayout, javax.swing.plaf.metal.MetalFileChooserUI.ButtonAreaLayout, javax.swing.plaf.metal.MetalSplitPaneDivider.MetalDividerLayout, javax.swing.plaf.metal.MetalTitlePane.TitlePaneLayout, javax.swing.plaf.synth.SynthInternalFrameTitlePane.SynthTitlePaneLayout, javax.swing.plaf.synth.SynthSpinnerUI.SpinnerLayout, javax.swing.plaf.synth.SynthToolBarUI.SynthToolBarLayoutManager, com.sun.java.swing.plaf.gtk.Metacity.TitlePaneLayout, com.sun.java.swing.plaf.motif.MotifInternalFrameTitlePane, sun.swing.plaf.synth.SynthFileChooserUIImpl.ButtonAreaLayout, java.awt.FlowLayout, java.awt.GridLayout

Defines the interface for classes that know how to lay out Containers.

Swing's painting architecture assumes the children of a JComponent do not overlap. If a JComponent's LayoutManager allows children to overlap, the JComponent must override isOptimizedDrawingEnabled to return false.

Authors
Sami Shaio, Arthur van Hoff
See Also
Container, javax.swing.JComponent#isOptimizedDrawingEnabled

Method Summary

Modifier and TypeMethod and Description
public void
addLayoutComponent(String
the string to be associated with the component
name
,
Component
the component to be added
comp
)

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

public void
layoutContainer(Container
the container to be laid out
parent
)

Lays out the specified container.

public Dimension

Returns:

the minimum dimension for the container
minimumLayoutSize
(Container
the component to be laid out
parent
)

Calculates the minimum size dimensions for the specified container, given the components it contains.

public Dimension

Returns:

the preferred dimension for the container
preferredLayoutSize
(Container
the container to be laid out
parent
)

Calculates the preferred size dimensions for the specified container, given the components it contains.

public void
removeLayoutComponent(Component
the component to be removed
comp
)

Removes the specified component from the layout.

Method Detail

addLayoutComponentback to summary
public void addLayoutComponent(String name, Component comp)

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

Parameters
name:String

the string to be associated with the component

comp:Component

the component to be added

layoutContainerback to summary
public void layoutContainer(Container parent)

Lays out the specified container.

Parameters
parent:Container

the container to be laid out

minimumLayoutSizeback to summary
public Dimension minimumLayoutSize(Container parent)

Calculates the minimum size dimensions for the specified container, given the components it contains.

Parameters
parent:Container

the component to be laid out

Returns:Dimension

the minimum dimension for the container

See Also
preferredLayoutSize
preferredLayoutSizeback to summary
public Dimension preferredLayoutSize(Container parent)

Calculates the preferred size dimensions for the specified container, given the components it contains.

Parameters
parent:Container

the container to be laid out

Returns:Dimension

the preferred dimension for the container

See Also
minimumLayoutSize
removeLayoutComponentback to summary
public void removeLayoutComponent(Component comp)

Removes the specified component from the layout.

Parameters
comp:Component

the component to be removed