public class PopupFactory extends Object
PopupFactory
,顾名思义,是用来获取实例
Popup
s。
Popup
s用于显示在一个特定的控制层次上的所有其他
Component
s一
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 可获得
Popup s。
|
static void |
setSharedInstance(PopupFactory factory)
集
PopupFactory 将用于获得
Popup s。
|
public static void setSharedInstance(PopupFactory factory)
PopupFactory
将用于获得
Popup
s。这将是如果
factory
空抛出一个
IllegalArgumentException
。
factory
- Shared PopupFactory
IllegalArgumentException
-如果
factory
是空的
getPopup(java.awt.Component, java.awt.Component, int, int)
public static PopupFactory getSharedInstance()
PopupFactory
可获得
Popup
s。
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.