|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.Popup
public class Popup
Popup 用于向用户显示 Component,它通常位于特定包含层次结构中所有其他 Component 的顶部。Popup 的生命周期很短。获取 Popup 并将它隐藏(调用 hide 方法)后,不应再对它调用任何方法。这允许 PopupFactory 缓存 Popup,以便将来使用。
常规协定是如果需要更改 Component 的大小或 Popup 的位置,应获取新的 Popup。
Popup 不是从 Component 继承的,Popup 的实现负责创建并维护其本身的 Component,以便向用户呈现请求的 Component。
一般不显式创建 Popup 的实例,而是改为从 PopupFactory 获取。
PopupFactory| 构造方法摘要 | |
|---|---|
protected |
Popup()
创建 Popup。 |
protected |
Popup(Component owner,
Component contents,
int x,
int y)
为包含 Component content 的 Component owner 创建 Popup。 |
| 方法摘要 | |
|---|---|
void |
hide()
隐藏和移除 Popup。 |
void |
show()
使 Popup 可见。 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
protected Popup(Component owner,
Component contents,
int x,
int y)
content 的 Component owner 创建 Popup。owner 用于确定对于哪一个 Window 新 Popup 是 Component(Popup 创建的)的父级。null owner 暗示不存在有效的父级。x 和 y 指定放置 Popup 的首选初始位置。基于屏幕大小或其他参数,Popup 不能显示在 x 和 y 处。
owner - 组件鼠标坐标与其相关,它可以为 nullcontents - Popup 的内容x - 初始 x 屏幕坐标y - 初始的 y 屏幕坐标
IllegalArgumentException - 如果内容为 nullprotected Popup()
Popup。这是为子类提供的。
| 方法详细信息 |
|---|
public void show()
Popup 可见。如果 Popup 当前可见,则无效。
public void hide()
Popup。移除 Popup 之后,不应再对它调用方法。可以回收 disposed Popup,然后再基于 PopupFactory 使用。同样,如果对 disposed Popup 调用方法,则会产生不确定的行为。
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。