- SWING 教程
- SWING - 主頁
- SWING - 概述
- SWING - 環境
- SWING - 控制元件
- SWING - 事件處理
- SWING - 事件類
- SWING - 事件偵聽器
- SWING - 事件介面卡
- SWING - 佈局
- SWING - 選單
- SWING - 容器
- SWING 有用資源
- SWING - 快速指南
- SWING - 有用資源
- SWING - 討論
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
廣告