public class ViewportLayout extends Object implements LayoutManager, Serializable
JViewport
默认的布局管理器。
ViewportLayout
定义一个布局,应该对大多数应用是有用的政策。视图使其视图尺寸为视图相同,但它不会使角度小于其最小尺寸。作为发展观保持底部视图对齐到整个视图是可见的,随后的观点保持顶对齐。
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
Constructor and Description |
---|
ViewportLayout() |
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(String name, Component c)
将指定的组件添加到布局中。
|
void |
layoutContainer(Container parent)
由AWT在指定的容器需要铺设。
|
Dimension |
minimumLayoutSize(Container parent)
返回布局所包含在指定目标容器中的组件所需的最小尺寸。
|
Dimension |
preferredLayoutSize(Container parent)
返回给定目标容器中的组件的此布局的首选尺寸。
|
void |
removeLayoutComponent(Component c)
从布局中移除指定的组件。
|
public void addLayoutComponent(String name, Component c)
addLayoutComponent
接口
LayoutManager
name
-组件的名称
c
的组件被添加
public void removeLayoutComponent(Component c)
removeLayoutComponent
接口
LayoutManager
c
-删除组件
public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
接口
LayoutManager
parent
-这需要把组件
Dimension
对象
minimumLayoutSize(java.awt.Container)
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
接口
LayoutManager
parent
-这需要把组件
Dimension
对象
preferredLayoutSize(java.awt.Container)
public void layoutContainer(Container parent)
layoutContainer
接口
LayoutManager
parent
-容器设计
AWTError
-如果目标不是指定给
BoxLayout
构造函数的容器
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.