Package java.awt |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
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
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 .
Parameter Description name a tag understood by this layout manager comp the component to be added
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 .
Parameter Description parent the container in which to do the layout.
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.
Parameter Description parent the container in which to do the layout See Also: 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.
Parameter Description parent the container in which to do the layout See Also: minimumLayoutSize .
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.
Parameter Description comp the component to be removed