public class PopupFactory extends Object
PopupFactory,顾名思义,是用来获取实例
Popups。
Popups用于显示在一个特定的控制层次上的所有其他
Components一
Component。一般的合同,一旦你从
PopupFactory获得
Popup,你必须调用
hide在
Popup。典型的用法是:
popupfactory厂= popupfactory。getsharedinstance();弹出弹出=工厂。getpopup(所有者、内容,x,y);show()弹出;…hide()弹出;
Popup
| Constructor and Description |
|---|
PopupFactory() |
| Modifier and Type | Method and Description |
|---|---|
Popup |
getPopup(Component owner, Component contents, int x, int y)
创建一个包含组件的组件
owner
Popup
contents。
|
static PopupFactory |
getSharedInstance()
收益共享
PopupFactory可获得
Popups。
|
static void |
setSharedInstance(PopupFactory factory)
集
PopupFactory将用于获得
Popups。
|
public static void setSharedInstance(PopupFactory factory)
PopupFactory将用于获得
Popups。这将是如果
factory空抛出一个
IllegalArgumentException。
factory - Shared PopupFactory
IllegalArgumentException -如果
factory是空的
getPopup(java.awt.Component, java.awt.Component, int, int)
public static PopupFactory getSharedInstance()
PopupFactory可获得
Popups。
public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException
contents
owner
Popup。
owner是用来确定新的
Popup将父母的
Component的
Popup创建,
Window。空
owner意味着没有有效的父。
x和
y指定地点的
Popup在首选的位置。基于屏幕尺寸,或其他参数,该
Popup可能不会显示在
x和
y。
owner组件的鼠标坐标是相对的,可能是空的
contents -内容
x初始屏幕X坐标
y初始y屏幕坐标
IllegalArgumentException如果内容是空的
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.