
SWING - LayoutManager2 Interface
Introduction
The interface LayoutManager is used to define the interface for classes that know how to lay out containers based on a layout constraints object.
Class Declaration
Following is the declaration for java.awt.LayoutManager2 interface −
public interface LayoutManger2 extends LayoutManager
Interface Methods
Sr.No. | Method & Description |
---|---|
1 |
void addLayoutComponent(Component comp, Object constraints) Adds the specified component to the layout, using the specified constraint object. |
2 |
float getLayoutAlignmentX(Container target) Returns the alignment along the x axis. |
3 |
float getLayoutAlignmentY(Container target) Returns the alignment along the y axis. |
4 |
void invalidateLayout(Container target) Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
5 |
Dimension maximumLayoutSize(Container target) Calculates the maximum size dimensions for the specified container, given the components it contains. |