LayoutManager2 介面


介紹

是用來定義的介面的類知道如何布置根據布局約束物件的容器的介面LayoutManger。

類的宣告

以下是宣告的java.awt.LayoutManager2介面:

public interface LayoutManger2
   extends LayoutManager

介面中的方法

S.N. 方法和說明
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.