JavaTM 2
Platform
Std.  Ed.  v1. 4.0

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

생성자의 개요
PopupFactory ()
           
 
메소드의 개요
 Popup getPopup (Component  owner, Component  contents, int x, int y)
          컴퍼넌트 contents 를 포함한 컴퍼넌트 ownerPopup 를 작성합니다.
static PopupFactory getSharedInstance ()
          Popup 를 취득하기 위해서 사용할 수 있는 공유 PopupFactory 를 돌려줍니다.
static void setSharedInstance (PopupFactory  factory)
          AppContext 고유의 PopupFactory 를 설정합니다.
 
클래스 java.lang. Object 에서 상속받은 메소드
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

생성자의 상세

PopupFactory

public PopupFactory()
메소드의 상세

setSharedInstance

public static void setSharedInstance(PopupFactory  factory)
AppContext 고유의 PopupFactory 를 설정합니다. factory 가 null 의 경우,IllegalArgumentException 를 슬로우 합니다.

파라미터:
factory - 공유 PopupFactory
예외:
IllegalArgumentException - factory 가 null 의 경우

getSharedInstance

public static PopupFactory  getSharedInstance()
Popup 를 취득하기 위해서 사용할 수 있는 공유 PopupFactory 를 돌려줍니다.

반환값:
공유 PopupFactory

getPopup

public Popup  getPopup(Component  owner,
                      Component  contents,
                      int x,
                      int y)
               throws IllegalArgumentException 
컴퍼넌트 contents 를 포함한 컴퍼넌트 ownerPopup 를 작성합니다. owner 는 어느 Window (새로운 Popup)가 Popup 의 작성처의 Component 의 부모가 되는지를 지정하기 위해서 사용합니다. owner 가 null 의 경우, 유효한 부모가 없는 것을 나타냅니다. xy 에는 Popup 를 최초로 배치하는 위치를 지정합니다. 화면의 사이즈나 다른 파라미터에 따라서는 Popupxy 에 표시되지 않는 것이 있습니다.

파라미터:
owner - 마우스의 좌표의 기준이 되는 Component. null 도 가능
contents - Popup 의 Contents
x - 초기의 x 화면 좌표
y - 초기의 y 화면 좌표
반환값:
Contents 를 포함한 Popup
예외:
IllegalArgumentException - contents 가 null 의 경우

JavaTM 2
Platform
Std.  Ed.  v1. 4.0

버그의 보고와 기능의 리퀘스트
이외의 API 레퍼런스 및 개발자용 문서에 대해서는 Java 2 SDK SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Java, Java 2 D, 및 JDBC 는 미국 및 그 외의 나라에 있어서의 미국 Sun Microsystems, Inc. 의 상표 혹은 등록상표입니다.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.