public class PopupFactory extends Object
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()
Popup を取得するために使用できる共有 PopupFactory を返します。 |
static void |
setSharedInstance(PopupFactory factory)
Popup の取得に使用される PopupFactory を設定します。 |
public static void setSharedInstance(PopupFactory factory)
Popup の取得に使用される PopupFactory を設定します。factory が null の場合、IllegalArgumentException をスローします。factory - 共有 PopupFactoryIllegalArgumentException - factory が null である場合getPopup(java.awt.Component, java.awt.Component, int, int)public static PopupFactory getSharedInstance()
Popup を取得するために使用できる共有 PopupFactory を返します。public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException
contents を含むコンポーネント owner の Popup を作成します。owner は、どの Window (新しい Popup) が Popup の作成先の Component の親となるかを指定するために使用します。owner が null の場合、有効な親がないことを示します。x と y には、Popup を最初に配置する位置を指定します。画面のサイズやほかのパラメータによっては、Popup が x と y の位置に表示されないことがあります。owner - マウスの座標の基準になる Component。null も可contents - Popup の Contentsx - 初期の x 画面座標y - 初期の y 画面座標IllegalArgumentException - contents が null の場合 バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.