JavaTM 2 Platform
Std. Ed. v1.3

javax.swing
クラス JWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--javax.swing.JWindow
すべての実装インタフェース:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable

public class JWindow
extends Window
implements Accessible, RootPaneContainer

JWindow は、ユーザのデスクトップ上のどこにでも表示できるコンテナです。タイトルバー、ウィンドウ管理ボタン、または JFrame に関連したほかの装飾を持ちませんが、それでもユーザのデスクトップの「最上級のメンバ」であり、そのどこにでも表示できます。

JWindow コンポーネントには、唯一の子として JRootPane が格納されます。contentPaneJWindow のすべての子の親になる必要があります。従来の java.awt.Window オブジェクトからは、通常は次のように操作します。

       window.add(child);
しかし、JWindow では次のようなコードになります。
       window.getContentPane().add(child);
LayoutManager の設定、コンポーネントの削除、子の一覧表示などの場合も同じです。通常、それらのメソッドはすべて JWindow 自体ではなく contentPane に送られなければなりません。contentPane は常に null 以外の値になります。null に設定しようとすると、JWindow が例外をスローします。デフォルトの contentPane には、BorderLayout マネージャが設定されます。

contentPaneglassPane、および layeredPane コンポーネントの詳細については、JRootPane の説明を参照してください。

マルチスクリーン環境の場合には、異なった画面デバイス上で JWindow を生成できます。詳細は、Window を参照してください。

標準の Look & Feel (L&F) 表現でこのコンポーネントが使用するキーボードのキーについては、JWindow のキーの割り当てを参照してください。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
JRootPane, 直列化された形式

内部クラスの概要
protected  class JWindow.AccessibleJWindow
          このクラスは JWindow クラス用のユーザ補助機能のサポートを実装しています。
 
クラス java.awt.Window から継承した内部クラス
Window.AccessibleAWTWindow
 
クラス java.awt.Container から継承した内部クラス
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承した内部クラス
Component.AccessibleAWTComponent
 
フィールドの概要
protected  AccessibleContext accessibleContext
          ユーザ補助機能のコンテキストプロパティです。
protected  JRootPane rootPane
          glassPane だけでなく、このフレームの contentPane およびオプションの menuBar を管理する JRootPane のインスタンスです。
protected  boolean rootPaneCheckingEnabled
          true の場合、add および setLayout を呼び出すと例外がスローされます。
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承したフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
JWindow()
          オーナの指定されていないウィンドウを作成します。
JWindow(Frame owner)
          指定したオーナフレームを持ったウィンドウを作成します。
JWindow(GraphicsConfiguration gc)
          ウィンドウを、画面デバイスの指定された GraphicsConfiguration にタイトルなしで作成します。
JWindow(Window owner)
          ウィンドウを、指定されたオーナで、画面デバイスの指定された GraphicsConfiguration に作成します。
JWindow(Window owner, GraphicsConfiguration gc)
           
 
メソッドの概要
protected  void addImpl(Component comp, Object constraints, int index)
          デフォルトでは、子はこのコンポーネントに直接追加できず、代わりに contentPane に追加されなければなりません。
protected  JRootPane createRootPane()
          コンストラクタメソッドによって呼び出され、デフォルトの rootPane を作成します。
 AccessibleContext getAccessibleContext()
          この JWindow に関連した AccessibleContext を返します。
 Container getContentPane()
          このウィンドウの contentPane である Container を返します。
 Component getGlassPane()
          このウィンドウの glassPane Component を返します。
 JLayeredPane getLayeredPane()
          このウィンドウの layeredPane オブジェクトを返します。
 JRootPane getRootPane()
          このウィンドウの rootPane オブジェクトを返します。
protected  boolean isRootPaneCheckingEnabled()
          add および setLayout の呼び出しが例外をスローするかどうかを返します。
protected  String paramString()
          この JWindow の文字列表現を返します。
 void remove(Component comp)
          コンテナから、指定されたコンポーネントを削除します。
 void setContentPane(Container contentPane)
          このウィンドウの contentPane プロパティを設定します。
 void setGlassPane(Component glassPane)
          glassPane プロパティを設定します。
 void setLayeredPane(JLayeredPane layeredPane)
          layeredPane プロパティを設定します。
 void setLayout(LayoutManager manager)
          デフォルトでは、このコンポーネントのレイアウトは設定できません。
protected  void setRootPane(JRootPane root)
          このウィンドウの新しい rootPane オブジェクトを設定します。
protected  void setRootPaneCheckingEnabled(boolean enabled)
          add および setLayout の呼び出しが例外をスローするかどうかを設定します。
protected  void windowInit()
          JWindow を適切に初期化するためにコンストラクタによって呼び出されます。
 
クラス java.awt.Window から継承したメソッド
addNotify, addWindowListener, applyResourceBundle, applyResourceBundle, dispose, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, show, toBack, toFront
 
クラス java.awt.Container から継承したメソッド
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, update, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

rootPane

protected JRootPane rootPane
glassPane だけでなく、このフレームの contentPane およびオプションの menuBar を管理する JRootPane のインスタンスです。
関連項目:
getRootPane(), setRootPane(javax.swing.JRootPane)

rootPaneCheckingEnabled

protected boolean rootPaneCheckingEnabled
true の場合、add および setLayout を呼び出すと例外がスローされます。
関連項目:
isRootPaneCheckingEnabled(), setRootPaneCheckingEnabled(boolean)

accessibleContext

protected AccessibleContext accessibleContext
ユーザ補助機能のコンテキストプロパティです。
コンストラクタの詳細

JWindow

public JWindow()
オーナの指定されていないウィンドウを作成します。

JWindow

public JWindow(GraphicsConfiguration gc)
ウィンドウを、画面デバイスの指定された GraphicsConfiguration にタイトルなしで作成します。
パラメータ:
gc - 新しいいウィンドウを構築するために使用される GraphicsConfigurationgcnull の場合は、システムのデフォルトは、GraphicsConfiguration と考えられる
例外:
IllegalArgumentException - gc が画面デバイスで指定されたものでない場合
導入されたバージョン:
1.3

JWindow

public JWindow(Frame owner)
指定したオーナフレームを持ったウィンドウを作成します。ownernull の場合は、共有オーナが使用されます。
パラメータ:
owner - ウィンドウが表示されるフレーム

JWindow

public JWindow(Window owner)
ウィンドウを、指定されたオーナで、画面デバイスの指定された GraphicsConfiguration に作成します。
パラメータ:
owner - オーナとして機能するウィンドウ
gc - 新しい Window を構築するために使用される GraphicsConfigurationgcnull の場合、システムのデフォルトは、GraphicsConfiguration と考えられる
例外:
IllegalArgumentException - gc が画面デバイスで指定されたものでない場合
IllegalArgumentException - オーナが null の場合
導入されたバージョン:
1.3

JWindow

public JWindow(Window owner,
               GraphicsConfiguration gc)
メソッドの詳細

windowInit

protected void windowInit()
JWindow を適切に初期化するためにコンストラクタによって呼び出されます。

createRootPane

protected JRootPane createRootPane()
コンストラクタメソッドによって呼び出され、デフォルトの rootPane を作成します。

isRootPaneCheckingEnabled

protected boolean isRootPaneCheckingEnabled()
add および setLayout の呼び出しが例外をスローするかどうかを返します。
戻り値:
add および setLayout が調べられる場合は true
関連項目:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), setRootPaneCheckingEnabled(boolean)

setRootPaneCheckingEnabled

protected void setRootPaneCheckingEnabled(boolean enabled)
add および setLayout の呼び出しが例外をスローするかどうかを設定します。
パラメータ:
enabled - boolean 値。true の場合は、調査を有効にして例外をスローする
関連項目:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), isRootPaneCheckingEnabled()

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
デフォルトでは、子はこのコンポーネントに直接追加できず、代わりに contentPane に追加されなければなりません。次に例を示します。
 thisComponent.getContentPane().add(child)
このコンポーネントに直接追加しようとすると、実行時例外がスローされます。サブクラスはこの動作を無効にできます。
オーバーライド:
クラス Container 内の addImpl
パラメータ:
comp - 拡張されるコンポーネント
constraints - コンポーネントで遵守されるべき制約
index - コンポーネントのインデックス
例外:
Error - rootPaneChecking で呼び出された場合は、true
関連項目:
setRootPaneCheckingEnabled(boolean)

remove

public void remove(Component comp)
コンテナから、指定されたコンポーネントを削除します。
オーバーライド:
クラス Container 内の remove
パラメータ:
comp - 削除されるコンポーネント
関連項目:
Container.add(java.awt.Component)

setLayout

public void setLayout(LayoutManager manager)
デフォルトでは、このコンポーネントのレイアウトは設定できません。代わりに、contentPane のレイアウトを設定しなければなりません。次に例を示します。
 thisComponent.getContentPane().setLayout(new BorderLayout())
このコンポーネントのレイアウトを設定しようとすると、実行時例外がスローされます。サブクラスはこの動作を無効にできます。
オーバーライド:
クラス Container 内の setLayout
パラメータ:
manager - ウィンドウのレイアウトマネージャ
例外:
Error - rootPaneChecking で呼び出された場合は、true
関連項目:
setRootPaneCheckingEnabled(boolean)

getRootPane

public JRootPane getRootPane()
このウィンドウの rootPane オブジェクトを返します。
定義:
インタフェース RootPaneContainer 内の getRootPane
戻り値:
このウィンドウの rootPane プロパティ
関連項目:
setRootPane(javax.swing.JRootPane), RootPaneContainer.getRootPane()

setRootPane

protected void setRootPane(JRootPane root)
このウィンドウの新しい rootPane オブジェクトを設定します。このメソッドはコンストラクタによって呼び出されます。
パラメータ:
root - 新しい rootPane プロパティ
関連項目:
getRootPane()

getContentPane

public Container getContentPane()
このウィンドウの contentPane である Container を返します。
定義:
インタフェース RootPaneContainer 内の getContentPane
戻り値:
contentPane プロパティ
関連項目:
setContentPane(java.awt.Container), RootPaneContainer.getContentPane()

setContentPane

public void setContentPane(Container contentPane)
このウィンドウの contentPane プロパティを設定します。このメソッドはコンストラクタによって呼び出されます。
定義:
インタフェース RootPaneContainer 内の setContentPane
パラメータ:
contentPane - 新しい contentPane
例外:
IllegalComponentStateException - (実行時例外) コンテンツ区画パラメータが null の場合
関連項目:
getContentPane(), RootPaneContainer.setContentPane(java.awt.Container)

getLayeredPane

public JLayeredPane getLayeredPane()
このウィンドウの layeredPane オブジェクトを返します。
定義:
インタフェース RootPaneContainer 内の getLayeredPane
戻り値:
layeredPane プロパティ
関連項目:
setLayeredPane(javax.swing.JLayeredPane), RootPaneContainer.getLayeredPane()

setLayeredPane

public void setLayeredPane(JLayeredPane layeredPane)
layeredPane プロパティを設定します。このメソッドはコンストラクタによって呼び出されます。
定義:
インタフェース RootPaneContainer 内の setLayeredPane
パラメータ:
layeredPane - 新しい layeredPane オブジェクト
例外:
IllegalComponentStateException - (実行時例外) コンテンツ区画パラメータが null の場合
関連項目:
getLayeredPane(), RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)

getGlassPane

public Component getGlassPane()
このウィンドウの glassPane Component を返します。
定義:
インタフェース RootPaneContainer 内の getGlassPane
戻り値:
glassPane プロパティ
関連項目:
setGlassPane(java.awt.Component), RootPaneContainer.getGlassPane()

setGlassPane

public void setGlassPane(Component glassPane)
glassPane プロパティを設定します。このメソッドはコンストラクタによって呼び出されます。
定義:
インタフェース RootPaneContainer 内の setGlassPane
パラメータ:
glassPane - このウィンドウの glassPane オブジェクト
関連項目:
getGlassPane(), RootPaneContainer.setGlassPane(java.awt.Component)

paramString

protected String paramString()
この JWindow の文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。
オーバーライド:
クラス Container 内の paramString
戻り値:
この JWindow 文字列表現

getAccessibleContext

public AccessibleContext getAccessibleContext()
この JWindow に関連した AccessibleContext を返します。JWindow の場合、AccessibleContext は AccessibleJWindow の形式を取ります。必要に応じて新規の AccessibleJWindow インスタンスが作成されます。
定義:
インタフェース Accessible 内の getAccessibleContext
オーバーライド:
クラス Window 内の getAccessibleContext
戻り値:
この JWindow の AccessibleContext として機能する AccessibleJWindow

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.