|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.PopupFactory
public class PopupFactory
顧名思義,PopupFactory 用於獲取 Popup 的實例。Popup 用於顯示特定包含層次結構中所有其他 Component 之上的 Component。常規協定是從 PopupFactory 獲取 Popup 之後,必須調用 Popup 上的 hide。一般用法為:
PopupFactory factory = PopupFactory.getSharedInstance(); Popup popup = factory.getPopup(owner, contents, x, y); popup.show(); ... popup.hide();
Popup| 建構子摘要 | |
|---|---|
PopupFactory()
|
|
| 方法摘要 | |
|---|---|
Popup |
getPopup(Component owner,
Component contents,
int x,
int y)
為包含 Component contents 的 Component owner 創建 Popup。 |
static PopupFactory |
getSharedInstance()
返回共享 PopupFactory,它可用於獲取 Popup。 |
static void |
setSharedInstance(PopupFactory factory)
設置用於獲取 Popup 的 PopupFactory。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public PopupFactory()
| 方法詳細資訊 |
|---|
public static void setSharedInstance(PopupFactory factory)
Popup 的 PopupFactory。如果 factory 為 null,這將拋出 IllegalArgumentException。
factory - Shared PopupFactory
IllegalArgumentException - 如果 factory 為 nullgetPopup(java.awt.Component, java.awt.Component, int, int)public static PopupFactory getSharedInstance()
PopupFactory,它可用於獲取 Popup。
public Popup getPopup(Component owner,
Component contents,
int x,
int y)
throws IllegalArgumentException
contents 的 Component owner 創建 Popup。owner 用於確定 Window,新 Popup 將其作為創建 Popup 的 Component 的父級。null owner 暗示不存在有效的父級。x 和 y 指定放置 Popup 的首選初始位置。基於螢幕大小或其他參數,Popup 不能顯示在 x 和 y 處。
owner - 元件鼠標坐標與其相關,它可以為 nullcontents - Popup 的內容x - 初始的 x 螢幕坐標y - 初始的 y 螢幕坐標
IllegalArgumentException - 如果內容為 null
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。