public class Popup extends Object
Component给用户,通常在所有在另一个的顶部Component中特定包含层次结构秒。
Popup的生命周期很小。
一旦你获得了一个Popup ,并隐藏(调用了hide方法),你就不再需要调用任何方法了。
这允许PopupFactory缓存Popup以供以后使用。
一般的合同是,如果你需要改变的大小Component的,或者位置Popup ,您应该获得一个新Popup 。
Popup不会下降Component ,而的实现Popup负责创建和维护自己Component s到渲染要求Component给用户。
你通常不会明确创建的实例Popup ,而不是获得一个从PopupFactory 。
PopupFactory
protected Popup(Component owner, Component contents, int x, int y)
Popup为组件owner包含Component contents 。
owner被用来确定哪个Window新Popup意愿父Component的Popup创建对。
null owner意味着没有有效的父。
x和y指定放置Popup的首选初始位置。
根据屏幕尺寸或其他参数, Popup可能不会显示在x和y 。
owner - 组件鼠标坐标是相对的,可以是null
contents - 弹出窗口的内容
x - 初始x屏幕坐标
y - 初始y屏幕坐标
IllegalArgumentException - 如果内容为空
protected Popup()
Popup 。
这是为子类提供的。
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.