public class JRootPane extends JComponent implements Accessible
JFrame、JDialog、JWindow、JApplet、およびJInternalFrameによって内部的に使用される軽量コンテナ。 ルート・ペインが提供するタスク指向の情報については、『The Java Tutorial』の「How to Use Root Panes」を参照してください。
次のイメージはルート・ペインを使用するクラス間の関係を示します。

JFrame、JDialog、JWindow、およびJApplet)は、それらが拡張するAWTクラスとの関連で示されています。 Swingライブラリ内の重量コンテナはこれら4つのコンポーネントのみです。 また、軽量コンテナのJInternalFrameも示されています。 これら5つのJFC/SwingコンテナはすべてRootPaneContainerインタフェースを実装し、処理をJRootPane (上部に小さな「ハンドル」が付いている)に委譲します。
ノート:JComponentのメソッドgetRootPaneを使用すると、指定されたコンポーネントを格納しているJRootPaneを取得できます。
|
JRootPaneの構造を示しています。 JRootpaneは、glassPane、オプションのmenuBar、およびcontentPaneから成ります。 JLayeredPaneはmenuBarとcontentPaneを管理します。 glassPaneはすべてのコンポーネントのいちばん上に置かれ、マウスの動作を捕捉します。 glassPaneは(contentPaneと同様に)、任意コンポーネントにすることができるので、描画のためにglassPaneをセット・アップすることもできます。 glassPane上の線とイメージは、境界に制限されることなく、下のフレーム全体を覆うことができます。
menuBarコンポーネントはなくてもかまいませんが、layeredPane、contentPane、およびglassPaneは必ず必要です。 これらをnullに設定しようとすると、例外が生成されます。
JRootPaneにコンポーネントを追加するには(オプションのメニュー・バーと異なり)、次のようにJRootPaneのcontentPaneにオブジェクトを追加します。
rootPane.getContentPane().add(child);
同様の原則が、レイアウト・マネージャの設定、コンポーネントの削除、および子のリスト表示などでも適用されます。これらのメソッドはすべてJRootPaneではなく、contentPaneで呼び出されます。
ノート:contentPaneのデフォルトのレイアウト・マネージャはBorderLayoutマネージャです。 ただし、JRootPaneはカスタムLayoutManagerを使用します。 したがって、JRootPaneに追加したコンポーネントのレイアウト・マネージャを変更するときは、必ず次のようなコードを使用してください。rootPane.getContentPane().setLayout(new BoxLayout());
JMenuBarコンポーネントがJRootPaneで設定された場合は、フレームの上端に沿って配置されます。 contentPaneの位置とサイズは、残りの領域に収まるように調整されます。 JMenuBarとcontentPaneは、JLayeredPane.FRAME_CONTENT_LAYERレイヤーのlayeredPaneコンポーネントに追加されます。
layeredPaneはJRootPaneのすべての子の親(メニューの直接の親、およびcontentPaneに追加されたすべてのコンポーネントの親の両方)です。 layeredPaneは、複数のレイヤーでコンポーネントを追加する機能を提供するJLayeredPaneのインスタンスです。 この機能は、メニュー・ポップアップやダイアログ・ボックスでの作業およびドラッグなど、コンポーネントをペイン内のほかのすべてのコンポーネントのいちばん上に配置する必要がある場合にとても便利です。
glassPaneはJRootPaneのほかのすべてのコンポーネントのいちばん上に置かれます。 これにより、ほかのすべてのコンポーネントの上に描画するのに都合のよい場所が提供され、ドラッグや描画のときに便利なマウス・イベントの捕捉が可能になります。 glassPaneでsetVisibleを使用すると、いつglassPaneがほかの子の上に表示されるかを制御できます。 デフォルトでは、glassPaneは可視ではありません。
JRootPaneによって使用されるカスタムLayoutManagerは次のことを保証します。
glassPaneはJRootPane (境界 - イン・セット)の表示可能領域全体を埋める。
layeredPaneはJRootPane(境界 - イン・セット)の表示可能領域全体を埋める。
menuBarはlayeredPaneの上端に配置される。
contentPaneは、menuBarを除いた(存在する場合)表示可能領域全体を埋める。
JRootPaneのビュー階層のほかのビューはすべて無視されます。
JRootPaneのLayoutManagerを置換する場合は、これらのビューすべてを管理する必要があります。 したがって、通常はJRootPaneではなくcontentPaneのレイアウト・マネージャを変更するようにしてください。
Swingのペイント・アーキテクチャでは、不透明なJComponentが包含関係の階層の中でほかのすべてのコンポーネントの上に存在する必要があります。 通常、これはコンテンツ・ペインによって提供されます。 コンテンツ・ペインを置き換える場合は、setOpaque(true)によってコンテンツ・ペインを不透明にすることをお勧めします。 また、コンテンツ・ペインによってpaintComponentがオーバーライドされる場合は、バックグラウンドをpaintComponentの不透明な色で完全に塗りつぶす必要があります。
警告: Swingはスレッドに対して安全ではありません。 詳細は、「Swing's Threading Policy」を参照してください。
警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースと互換ではなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートがjava.beansパッケージに追加されています。 XMLEncoderを参照してください。
| 修飾子と型 | クラス | 説明 |
|---|---|---|
protected class |
JRootPane.AccessibleJRootPane |
このクラスは
JRootPaneクラスのアクセシビリティ・サポートを実装しています。 |
protected class |
JRootPane.RootLayout |
layeredPane、glassPane、およびmenuBarのレイアウトを処理するカスタム・レイアウト・マネージャです。
|
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| 修飾子と型 | フィールド | 説明 |
|---|---|---|
static int |
COLOR_CHOOSER_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
protected Container |
contentPane |
コンテンツ・ペインです。
|
protected JButton |
defaultButton |
ペインがフォーカスを持つとき、およびEnterキーを押すなどのUI固有のアクションを持つときにアクティブになるボタンです。
|
protected javax.swing.JRootPane.DefaultAction |
defaultPressAction |
非推奨。
Java 2プラットフォームv1.3以降。
|
protected javax.swing.JRootPane.DefaultAction |
defaultReleaseAction |
非推奨。
Java 2プラットフォームv1.3以降。
|
static int |
ERROR_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
static int |
FILE_CHOOSER_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
static int |
FRAME |
windowDecorationStyleプロパティに使用する定数です。
|
protected Component |
glassPane |
メニュー・バーとコンテンツ・ペインにオーバーレイするガラス・ペインです。マウスの動作などを捕捉できます。
|
static int |
INFORMATION_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
protected JLayeredPane |
layeredPane |
メニュー・バーとコンテンツ・ペインを管理する階層化ペインです。
|
protected JMenuBar |
menuBar |
メニュー・バーです。
|
static int |
NONE |
windowDecorationStyleプロパティに使用する定数です。
|
static int |
PLAIN_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
static int |
QUESTION_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
static int |
WARNING_DIALOG |
windowDecorationStyleプロパティに使用する定数です。
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| コンストラクタ | 説明 |
|---|---|
JRootPane() |
JRootPaneを作成し、glassPane、layeredPane、およびcontentPaneを設定します。 |
| 修飾子と型 | メソッド | 説明 |
|---|---|---|
protected void |
addImpl(Component comp, Object constraints, int index) |
ガラス・コンポーネントの位置を子0として適用するためにオーバーライドされます。
|
void |
addNotify() |
このコンポーネントに現在親コンポーネントがあることを、このコンポーネントに通知します。
|
protected Container |
createContentPane() |
デフォルトの
contentPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 |
protected Component |
createGlassPane() |
デフォルトの
glassPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 |
protected JLayeredPane |
createLayeredPane() |
デフォルトの
layeredPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 |
protected LayoutManager |
createRootLayout() |
デフォルトの
layoutManagerを作成するために、コンストラクタ・メソッドから呼び出されます。 |
AccessibleContext |
getAccessibleContext() |
この
JRootPaneに関連付けられているAccessibleContextを取得します。 |
Container |
getContentPane() |
ルート・ペインが親になるコンポーネントを保持するコンテナである、コンテンツ・ペインを返します。
|
JButton |
getDefaultButton() |
defaultButtonプロパティの値を返します。 |
Component |
getGlassPane() |
この
JRootPaneの現在のガラス・ペインを返します。 |
JMenuBar |
getJMenuBar() |
階層化ペインからメニュー・バーを返します。
|
JLayeredPane |
getLayeredPane() |
ルート・ペインが使用する階層化ペインを取得します。
|
JMenuBar |
getMenuBar() |
非推奨。
Swing version 1.0.3以降は、
getJMenuBar()に置き換えられています。 |
RootPaneUI |
getUI() |
このコンポーネントを描画するL&Fオブジェクトを返します。
|
String |
getUIClassID() |
このコンポーネントをレンダリングするL&Fクラスの名前を指定する文字列を返します。
|
int |
getWindowDecorationStyle() |
JRootPaneが提供するウィンドウ装飾のタイプを識別する定数を返します。 |
boolean |
isOptimizedDrawingEnabled() |
glassPaneとcontentPaneは同じ境界を持つため、JRootPaneはその子をタイリングせず、falseを返します。 |
boolean |
isValidateRoot() |
この
JRootPaneの下位オブジェクトがrevalidateを呼び出した場合、ここから下へ向かって検証します。 |
protected String |
paramString() |
この
JRootPaneの文字列表現を返します。 |
void |
removeNotify() |
このコンポーネントに親コンポーネントがなくなったことを、このコンポーネントに通知します。
|
void |
setContentPane(Container content) |
ルート・ペインが親になるコンポーネントを保持するコンテナである、コンテンツ・ペインを設定します。
|
void |
setDefaultButton(JButton defaultButton) |
defaultButtonプロパティを設定して、このJRootPaneの現在のデフォルト・ボタンを指定します。 |
void |
setDoubleBuffered(boolean aFlag) |
このコンポーネントがバッファを使用してペイントするかどうかを設定します。
|
void |
setGlassPane(Component glass) |
指定した
Componentがこのルート・ペインのガラス・ペインになるように設定します。 |
void |
setJMenuBar(JMenuBar menu) |
階層化ペインで使用されるメニュー・バーを追加または変更します。
|
void |
setLayeredPane(JLayeredPane layered) |
ルート・ペインに階層化ペインを設定します。
|
void |
setMenuBar(JMenuBar menu) |
非推奨。
Swing version 1.0.3以降は、
setJMenuBar(JMenuBar menu)に置き換えられています。 |
void |
setUI(RootPaneUI ui) |
このコンポーネントを描画するL&Fオブジェクトを設定します。
|
void |
setWindowDecorationStyle(int windowDecorationStyle) |
JRootPaneが提供するウィンドウ装飾の種類(ボーダー、Windowを閉じるためのウィジェット、タイトルなど)を設定します。 |
void |
updateUI() |
現在のルック・アンド・フィールからの値にUIプロパティをリセットします。
|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int NONE
JRootPaneがどんなWindow装飾も提供しないように指示します。 public static final int FRAME
JRootPaneがFrameに適した装飾を提供するように指示します。 public static final int PLAIN_DIALOG
JRootPaneがDialogに適した装飾を提供するように指示します。 public static final int INFORMATION_DIALOG
JRootPaneが、情報メッセージを表示するためのDialogに適した装飾を提供するように指示します。 public static final int ERROR_DIALOG
JRootPaneが、エラー・メッセージを表示するためのDialogに適した装飾を提供するように指示します。 public static final int COLOR_CHOOSER_DIALOG
JRootPaneが、JColorChooserを表示するためのDialogに適した装飾を提供するように指示します。 public static final int FILE_CHOOSER_DIALOG
JRootPaneが、JFileChooserを表示するためのDialogに適した装飾を提供するように指示します。 public static final int QUESTION_DIALOG
JRootPaneが、ユーザーにクエスチョンを表示するためのDialogに適した装飾を提供するように指示します。 public static final int WARNING_DIALOG
JRootPaneが、警告メッセージを表示するためのDialogに適切な装飾を提供するように指示します。 protected JMenuBar menuBar
protected Container contentPane
protected JLayeredPane layeredPane
protected Component glassPane
protected JButton defaultButton
@Deprecated protected javax.swing.JRootPane.DefaultAction defaultPressAction
JRootPaneのActionMapのActionを置き換えます。 詳細は、キー・バインディング仕様を参照してください。 defaultButton@Deprecated protected javax.swing.JRootPane.DefaultAction defaultReleaseAction
JRootPaneのActionMapのActionを置き換えます。 詳細は、キー・バインディング仕様を参照してください。 defaultButtonpublic void setDoubleBuffered(boolean aFlag)
Componentがバッファリングされており、その上位オブジェクトもバッファリングされている場合、上位オブジェクトのバッファが使用されます。 setDoubleBuffered、クラスJComponentaFlag - trueの場合、このコンポーネントでダブル・バッファを使用するように設定public int getWindowDecorationStyle()
JRootPaneが提供するウィンドウ装飾のタイプを識別する定数を返します。NONE、FRAME、PLAIN_DIALOG、INFORMATION_DIALOG、ERROR_DIALOG、COLOR_CHOOSER_DIALOG、FILE_CHOOSER_DIALOG、QUESTION_DIALOG、またはWARNING_DIALOGのいずれか。setWindowDecorationStyle(int)public void setWindowDecorationStyle(int windowDecorationStyle)
JRootPaneが提供するウィンドウ装飾の種類(ボーダー、Windowを閉じるためのウィジェット、タイトルなど)を設定します。 デフォルトの設定はWindow装飾なし(NONE)です。
これはヒントに過ぎず、一部のルック・アンド・フィールはこれをサポートしていません。 これはバウンド・プロパティです。
windowDecorationStyle - 提供するウィンドウの装飾を識別する定数。IllegalArgumentException - styleがNONE、FRAME、PLAIN_DIALOG、INFORMATION_DIALOG、ERROR_DIALOG、COLOR_CHOOSER_DIALOG、FILE_CHOOSER_DIALOG、QUESTION_DIALOG、またはWARNING_DIALOGのいずれでもない場合。JDialog.setDefaultLookAndFeelDecorated(boolean), JFrame.setDefaultLookAndFeelDecorated(boolean), LookAndFeel.getSupportsWindowDecorations()public RootPaneUI getUI()
LabelUIオブジェクトpublic void setUI(RootPaneUI ui)
ui - LabelUI L&FオブジェクトUIDefaults.getUI(javax.swing.JComponent)public void updateUI()
updateUI、クラスJComponentJComponent.updateUI()public String getUIClassID()
getUIClassID、クラスJComponentJComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)protected JLayeredPane createLayeredPane()
layeredPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 デフォルトでは、新しいJLayeredPaneを作成します。 layeredPaneprotected Container createContentPane()
contentPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 デフォルトでは、このメソッドは新しいJComponentを作成し、LayoutManagerとしてBorderLayoutを設定します。 contentPaneprotected Component createGlassPane()
glassPaneを作成するために、コンストラクタ・メソッドから呼び出されます。 デフォルトでは、このメソッドは可視性をfalseに設定して新しいJComponentを作成します。 glassPaneprotected LayoutManager createRootLayout()
layoutManagerを作成するために、コンストラクタ・メソッドから呼び出されます。layoutManager。public void setJMenuBar(JMenuBar menu)
menu - 追加するJMenuBar@Deprecated public void setMenuBar(JMenuBar menu)
setJMenuBar(JMenuBar menu)に置き換えられています。 menu - 追加するJMenuBar。public JMenuBar getJMenuBar()
JMenuBar@Deprecated public JMenuBar getMenuBar()
getJMenuBar()に置き換えられています。 JMenuBarpublic void setContentPane(Container content)
Swingのペイント・アーキテクチャでは、包含関係の階層に不透明なJComponentが含まれている必要があります。 通常、これはコンテンツ・ペインによって提供されます。 コンテンツ・ペインを置き換える場合は、不透明なJComponentと置き換えることをお勧めします。
content - コンポーネント・コンテンツに使用するContainerIllegalComponentStateException - コンテンツ・ペイン・パラメータがnullの場合(実行時例外)public Container getContentPane()
Containerpublic void setLayeredPane(JLayeredPane layered)
JMenuBarを保持します。 layered - 使用するJLayeredPaneIllegalComponentStateException - 階層化ペイン・パラメータがnullの場合(実行時例外)public JLayeredPane getLayeredPane()
JMenuBarを保持します。 JLayeredPanepublic void setGlassPane(Component glass)
Componentがこのルート・ペインのガラス・ペインになるように設定します。 ルート・ペインが入力イベントを捕捉する必要があるときには必ず可視にされるので、通常、ガラス・ペインは軽量の透明なコンポーネントである必要があります。
新しいガラス・ペインの可視設定は、現在のガラス・ペインの可視設定に一致するように変更されます。 このため、ガラス・ペインを置き換えて可視にするときは、注意が必要です。 次のいずれかの方法を使用します。
root.setGlassPane(newGlassPane); newGlassPane.setVisible(true);または
root.getGlassPane().setVisible(true); root.setGlassPane(newGlassPane);
glass - このJRootPaneのガラス・ペインとして使用するComponentNullPointerException - glassパラメータがnullの場合public Component getGlassPane()
JRootPaneの現在のガラス・ペインを返します。setGlassPane(java.awt.Component)public boolean isValidateRoot()
JRootPaneの下位オブジェクトがrevalidateを呼び出した場合、ここから下へ向かって検証します。
コンポーネントおよびその子孫の再配置の延期された要求です。 たとえば、revalidateの呼出しはJRootPaneまたはJScrollPaneのどちらかに転送されます。これは、どちらのクラスもisValidateRootをオーバーライドしてtrueを返すためです。
isValidateRoot、クラスJComponentJComponent.isValidateRoot(), Container.isValidateRoot()public boolean isOptimizedDrawingEnabled()
glassPaneとcontentPaneは同じ境界を持つため、JRootPaneはその子をタイリングせず、falseを返します。 一方、通常glassPaneは不可視なので、glassPaneが可視でない場合、trueを返します。 つまり、このメソッドの戻り値はglassPaneの可視性によって異なります。 isOptimizedDrawingEnabled、クラスJComponentpublic void addNotify()
KeyboardActionイベント・リスナーで設定されます。 このメソッドは、ツールキットによって内部で呼び出され、プログラムから直接呼び出されることはありません。 public void removeNotify()
KeyboardActionが削除されます。 このメソッドは、ツールキットによって内部で呼び出され、プログラムから直接呼び出されることはありません。 public void setDefaultButton(JButton defaultButton)
defaultButtonプロパティを設定して、このJRootPaneの現在のデフォルト・ボタンを指定します。 デフォルト・ボタンは、ボタンにキーボード・フォーカスがあるかどうかにかかわらず、ルート・ペインでUI定義の起動イベント(通常はEnterキー)が発生したときに起動されるボタンです(ルート・ペイン内にJTextPaneなどの起動イベントを消費する別のコンポーネントがある場合を除く)。 デフォルトの起動が機能するには、ボタンは起動が発生した時点でルート・ペインの使用可能な子孫である必要があります。 このルート・ペインからデフォルト・ボタンを削除するには、このプロパティをnullに設定します。 defaultButton - デフォルト・ボタンになるJButtonJButton.isDefaultButton()public JButton getDefaultButton()
defaultButtonプロパティの値を返します。JButtonsetDefaultButton(javax.swing.JButton)protected void addImpl(Component comp, Object constraints, int index)
addImpl、クラスContainercomp - 拡張されるコンポーネントconstraints - 遵守されるべき制約index - インデックスContainer.add(Component), Container.add(Component, int), Container.add(Component, java.lang.Object), Container.invalidate(), LayoutManager, LayoutManager2protected String paramString()
JRootPaneの文字列表現を返します。 このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。 返される文字列は空の場合がありますが、nullにはなりません。 paramString、クラスJComponentJRootPaneを表す文字列表現。public AccessibleContext getAccessibleContext()
JRootPaneに関連付けられているAccessibleContextを取得します。 ルート・ペインの場合、AccessibleContextはAccessibleJRootPaneの形式を取ります。 必要に応じて、新しいAccessibleJRootPaneインスタンスが作成されます。 getAccessibleContext、インタフェースAccessiblegetAccessibleContext、クラスComponentJRootPaneのAccessibleContextとして機能するAccessibleJRootPane バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。