Packages  This Package  Prev  Next  Index  

§1.43 Interface LayoutManager

public  interface  java.awt.LayoutManager
{
        // Methods
    public abstract void addLayoutComponent(String  name,	§1.43.1
        Component  comp);
    public abstract void layoutContainer(Container  parent);	§1.43.2
        public abstract Dimension 	§1.43.3
        minimumLayoutSize(Container  parent);
    public abstract Dimension	§1.43.4
        preferredLayoutSize(Container  parent);
    public abstract void	§1.43.5
        removeLayoutComponent(Component  comp);
}
The LayoutManager interface specifies the methods that all layout managers must implement.

A layout manager is a class for laying out the components of a Container (II-§1.11)


Methods

addLayoutComponent

public abstract void
addLayoutComponent(String name, Component comp)
Adds the specified component to this layout using the indicated tag.
Most applications do not call this method directly. This method is called when a component is added to a container using the add(String, Component) method (II-§1.11.3).

Parameters:
name - a tag understood by this layout manager
comp - the component to be added

layoutContainer

public abstract void layoutContainer(Container parent)
Lays out the container argument using this layout.
This method may reshape the components in the specified target container in order to satisfy the constraints of this layout manager.
Most applications do not call this method directly. This method is called when a container calls its layout method (II-§1.11.11).

Parameters:
parent - the container in which to do the layout.

minimumLayoutSize

public abstract Dimension
minimumLayoutSize(Container parent)
Determines the minimum size of the container argument using this layout manager. Most applications do not call this method directly. This method is called when a container calls its layout method (II-§1.11.11).

Parameters:
parent - the container in which to do the layout
Returns:
the minimum dimensions needed to lay out the subcomponents of the specified container.
See Also:
preferredLayoutSize (II-§1.43.4).

preferredLayoutSize

public abstract Dimension
preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using this layout manager. Most applications do not call this method directly. This method is called when a container calls its preferredSize method (II-§1.11.17).

Parameters:
parent - the container in which to do the layout
Returns:
the preferred dimensions to lay out the subcomponents of the specified container.
See Also:
minimumLayoutSize (II-§1.43.3).

removeLayoutComponent

public abstract void
removeLayoutComponent(Component comp)
Removes the specified component from this layout.
Most applications do not call this method directly. This method is called when a container calls its remove (II-§1.11.19) or removeAll (II-§1.11.20) methods.

Parameters:
comp - the component to be removed

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com