javax.swing
クラス PopupFactory
java.lang.Object
javax.swing.PopupFactory
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();
- 導入されたバージョン:
- 1.4
- 関連項目:
Popup
| クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PopupFactory
public PopupFactory()
setSharedInstance
public static void setSharedInstance(PopupFactory factory)
Popup を取得するために使用する PopupFactory を設定します。factory が null の場合は、IllegalArgumentException をスローします。
- パラメータ:
factory - 共有 PopupFactory
- 例外:
IllegalArgumentException - factory が null の場合- 関連項目:
getPopup(java.awt.Component, java.awt.Component, int, int)
getSharedInstance
public static PopupFactory getSharedInstance()
Popup を取得するために使うことのできる共有 PopupFactory を返します。
- 戻り値:
- 共有 PopupFactory
getPopup
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 画面座標
- 戻り値:
- Contents を含む Popup
- 例外:
IllegalArgumentException - contents が null の場合
バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java 2 SDK SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。