JavaTM Platform
Standard Ed. 6

javax.swing
인터페이스 RootPaneContainer

기존의 구현 클래스의 일람:
JApplet , JDialog , JFrame , JInternalFrame , JWindow


public interface RootPaneContainer

이 인터페이스는, JRootPane 의 아이를 1 살 가지는 JDialog, JFrame, JWindow, JApplet, JInternalFrame 등의 컴퍼넌트에 의해 구현됩니다. 이 인터페이스의 메소드는, JRootPane 프로퍼티의 「대신 」을 할 뿐입니다. 예를 들어,getContentPane() 는 일반적으로은 다음과 같이 구현 됩니다.

     public Container getContentPane() {
         return getRootPane(). getContentPane();
     }
 
이 인터페이스는, 단일의 JRootPane 를 가지는 JFrame 등의 컴퍼넌트를 특별히 처리하는 Swing GUI 빌더의 「마커」로서 기능합니다. 예를 들어 GUI 빌더에서는, RootPaneContainer 에 컴퍼넌트를 드롭 하면(자),frame.getContentPane(). add(child) 로서 해석됩니다.

편의상,JFrame,JDialog,JWindow,JApplet, 및 JInternalFrame 는 디폴트로 add,remove, 및 setLayout 메소드의 모든 호출을 contentPane 에 전송 합니다. 즉, 다음과 같이 호출할 수 있습니다.

 rootPaneContainer.add(component);
 
다음과 같이 기술할 필요는 없습니다.
 rootPaneContainer.getContentPane(). add(component);
 

JFrame,JDialog,JWindow,JApplet, 및 JInternalFrame 에 대한 addsetLayout 메소드의 동작은,rootPaneCheckingEnabled 프로퍼티에 의해 제어됩니다. 이 프로퍼티이 true (디폴트)의 경우는, 이러한 메소드의 호출이 contentPane 에 전송 됩니다. false 의 경우, 이러한 메소드는 RootPaneContainer 로 직접 실행됩니다. 이 프로퍼티은 서브 클래스만을 대상으로 하고 있기 (위해)때문에, 보호되고 있습니다.

관련 항목:
JRootPane , JFrame , JDialog , JWindow , JApplet , JInternalFrame

메소드의 개요
 Container getContentPane ()
          contentPane 를 돌려줍니다.
 Component getGlassPane ()
          glassPane 를 돌려줍니다.
 JLayeredPane getLayeredPane ()
          layeredPane 를 돌려줍니다.
 JRootPane getRootPane ()
          이 컴퍼넌트의 단일의 JRootPane 의 아이를 돌려줍니다.
 void setContentPane (Container  contentPane)
           「contentPane」는, 어플리케이션 고유의 컴퍼넌트의 일차 컨테이너입니다.
 void setGlassPane (Component  glassPane)
          glassPane 는 항상 rootPane 의 최초의 아이로, rootPane 의 레이아웃 매니저에 의해, 항상 rootPane 와 같은 크기인 것이 보증됩니다.
 void setLayeredPane (JLayeredPane  layeredPane)
          contentPane 를 관리하는 컨테이너로, 경우에 따라서는 도구모음도 관리합니다.
 

메소드의 상세

getRootPane

JRootPane  getRootPane()
이 컴퍼넌트의 단일의 JRootPane 의 아이를 돌려줍니다. 이 인터페이스의 일반적으로의 구현에서는, 다른 메소드는 모두 인터페이스 전체로 간접적으로 됩니다. rootPane 에는, glassPane 와 layeredPane 의 2 살의 아이가 있습니다.

반환값:
이 컴퍼넌트의 단일의 JRootPane 의 아이
관련 항목:
JRootPane

setContentPane

void setContentPane(Container  contentPane)
「contentPane」는, 어플리케이션 고유의 컴퍼넌트의 일차 컨테이너입니다. 어플리케이션에서는, contentPane 에 아이를 추가하거나 그 레이아웃 매니저를 설정하거나 합니다.

contentPane 를 null 로 할 수 없습니다.

일반적으로은, 다음과 같이 구현됩니다. getRootPane(). setContentPane(contentPane);

파라미터:
contentPane - 이 JRootPane 의 컨텐츠에 사용한다 컨테이너
예외:
IllegalComponentStateException - 컨텐츠 구획 파라미터가 null 의 경우 (실행시 예외)
관련 항목:
JRootPane.getContentPane() , getContentPane()

getContentPane

Container  getContentPane()
contentPane 를 돌려줍니다.

반환값:
contentPane 프로퍼티의 값
관련 항목:
setContentPane(java.awt.Container)

setLayeredPane

void setLayeredPane(JLayeredPane  layeredPane)
contentPane 를 관리하는 컨테이너로, 경우에 따라서는 도구모음도 관리합니다. layeredPane 를 이용할 수 있는 것은, 관리하고 있는 레이아웃이 아닌 RootPaneContainer 에 아이를 추가하는 하위 객체입니다. 예를 들어, 내부 다이얼로그나 드래그&드롭 효과를 가지는 컴퍼넌트 등입니다.

layeredPane 를 null 로 할 수 없습니다.

일반적으로은, 다음과 같이 구현됩니다.

    getRootPane(). setLayeredPane(layeredPane);

예외:
IllegalComponentStateException - 계층화 구획 파라미터가 null 의 경우 (실행시 예외)
관련 항목:
getLayeredPane() , JRootPane.getLayeredPane()

getLayeredPane

JLayeredPane  getLayeredPane()
layeredPane 를 돌려줍니다.

반환값:
layeredPane 프로퍼티의 값
관련 항목:
setLayeredPane(javax.swing.JLayeredPane)

setGlassPane

void setGlassPane(Component  glassPane)
glassPane 는 항상 rootPane 의 최초의 아이로, rootPane 의 레이아웃 매니저에 의해, 항상 rootPane 와 같은 크기인 것이 보증됩니다. 또, 디폴트에서는 투과로, 가시가 아닙니다. glassPane 를 사용하면(자), 청취자를 추가해 glassPane 를 가시로 설정하는 것으로, 모든 키보드 및 마우스 입력을 일시적으로 글로브 할 수 있습니다. 디폴트에서는, glassPane 는 가시가 아닙니다.

glassPane 를 null 로 설정할 수 없습니다.

일반적으로은, 다음과 같이 구현됩니다. getRootPane(). setGlassPane(glassPane);

관련 항목:
getGlassPane() , JRootPane.setGlassPane(java.awt.Component)

getGlassPane

Component  getGlassPane()
glassPane 를 돌려줍니다.

반환값:
glassPane 프로퍼티의 값
관련 항목:
setGlassPane(java.awt.Component)

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 도 참조해 주세요.