|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
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 に対する add および setLayout メソッドの動作は、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 を管理するコンテナで、場合によってはメニューバーも管理します。 |
| メソッドの詳細 |
|---|
JRootPane getRootPane()
JRootPanevoid setContentPane(Container contentPane)
contentPane を null にすることはできません。
通常は、次のように実装されます。getRootPane().setContentPane(contentPane);
contentPane - この JRootPane のコンテンツに使用する
コンテナ
IllegalComponentStateException - コンテンツ区画パラメータが
null の場合 (実行時例外)JRootPane.getContentPane(),
getContentPane()Container getContentPane()
setContentPane(java.awt.Container)void setLayeredPane(JLayeredPane layeredPane)
layeredPane を null にすることはできません。
通常は、次のように実装されます。
getRootPane().setLayeredPane(layeredPane);
IllegalComponentStateException - 階層化区画パラメータが
null の場合 (実行時例外)getLayeredPane(),
JRootPane.getLayeredPane()JLayeredPane getLayeredPane()
setLayeredPane(javax.swing.JLayeredPane)void setGlassPane(Component glassPane)
glassPane を null に設定することはできません。
通常は、次のように実装されます。 getRootPane().setGlassPane(glassPane);
getGlassPane(),
JRootPane.setGlassPane(java.awt.Component)Component getGlassPane()
setGlassPane(java.awt.Component)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。