SWING - 布局管理器接口



简介

LayoutManager 接口用于为了解如何布局容器的类定义接口。

类声明

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

public interface LayoutManager

接口方法

序号。 方法和说明
1

void addLayoutComponent(String name, Component comp)

如果布局管理器使用每个组件字符串,则将组件 comp 添加到布局中,将其与 name 指定的字符串关联。

2

void layoutContainer(Container parent)

布局指定的容器。

3

Dimension minimumLayoutSize(Container parent)

计算指定容器的最小尺寸维度,指定它所包含的组件。

4

Dimension preferredLayoutSize(Container parent)

计算指定容器的首选尺寸维度,指定它所包含的组件。

5

void removeLayoutComponent(Component comp)

从布局中移除指定的组件。

swing_layouts.htm
广告
© . All rights reserved.