JavaTM Platform
Standard Ed. 6

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)
          Popup 의 취득에 사용되는 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)
Popup 의 취득에 사용되는 PopupFactory 를 설정합니다. factory 가 null 의 경우,IllegalArgumentException 를 throw 합니다.

파라미터:
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 를 포함한 컴퍼넌트 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 Platform
Standard Ed. 6

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

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.