Package java.awt Previous
Previous
Java API
Java API
Index
Index
Next
Next

Interface LayoutManager

Methods

public  interface  java.awt.LayoutManager
{
        // Methods
    public abstract void addLayoutComponent(String  name,	
        Component  comp);
    public abstract void layoutContainer(Container  parent);	
        public abstract Dimension 	
        minimumLayoutSize(Container  parent);
    public abstract Dimension	
        preferredLayoutSize(Container  parent);
    public abstract void	
        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


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 .

ParameterDescription
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 .

ParameterDescription
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 .

Return Value:

Returns the minimum dimensions needed to lay out the subcomponents of the specified container.

ParameterDescription
parent the container in which to do the layout

See Also: preferredLayoutSize .


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 .

Return Value:

Returns the preferred dimensions to lay out the subcomponents of the specified container.

ParameterDescription
parent the container in which to do the layout

See Also: minimumLayoutSize .


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 or removeAll methods.

ParameterDescription
comp the component to be removed



Top© 1996 Sun Microsystems, Inc. All rights reserved.