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 以降、すべての JavaBeansTM 用の長期間の格納サポートが 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 プラットフォーム 1.3 以降使われていません。
|
protected javax.swing.JRootPane.DefaultAction |
defaultReleaseAction
非推奨。
Java 2 プラットフォーム 1.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 プロパティーに使用する定数です。
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_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()
現在の Look & Feel からの値に 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 JRootPane()
JRootPane を作成し、glassPane、layeredPane、および contentPane を設定します。public 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) です。
これはヒントに過ぎず、一部の Look & Feel はこれをサポートしていません。これはバウンドプロパティーです。
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 、クラス: JComponentJRootPane の AccessibleContext として機能する AccessibleJRootPane バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.