SWING - LayoutManager2 接口



简介

界面 LayoutManager 用于定义知道如何基于布局约束对象布置容器的类的接口。

类声明

以下是 java.awt.LayoutManager2 接口的声明 -

public interface LayoutManger2
   extends LayoutManager

接口方法

序号 方法和说明
1

void addLayoutComponent(Component comp, Object constraints)

使用指定的约束对象将指定的组件添加到布局。

2

float getLayoutAlignmentX(Container target)

返回沿 x 轴的对齐方式。

3

float getLayoutAlignmentY(Container target)

返回沿 y 轴的对齐方式。

4

void invalidateLayout(Container target)

使布局无效,表示如果布局管理器缓存了信息,则应丢弃该信息。

5

Dimension maximumLayoutSize(Container target)

根据容器中包含的组件计算指定容器的最大尺寸。

swing_layouts.htm
广告
© . All rights reserved.