javax.swing

Class JRootPane

public class JRootPane extends JComponent implements Accessible

This class is where JComponents are added to. Unlike awt where you could just say frame.add(), with swing you need to say frame.getRootPane() (which delivers an instance of this class) and add your components to that. It is implemented by several 'layers' (pane() should be read as plane()) each on top of the others where you can add components to. (getContentPane(), getGlassPane(), getLayeredPane())
Nested Class Summary
protected classJRootPane.AccessibleJRootPane
protected classJRootPane.RootLayout
Field Summary
protected ContainercontentPane
DOCUMENT ME!
static intCOLOR_CHOOSER_DIALOG
protected JButtondefaultButton
protected ActiondefaultPressAction
This field is unused since JDK1.3.
protected ActiondefaultReleaseAction
This field is unused since JDK1.3.
static intERROR_DIALOG
static intFILE_CHOOSER_DIALOG
static intFRAME
protected ComponentglassPane
DOCUMENT ME!
static intINFORMATION_DIALOG
protected JLayeredPanelayeredPane
DOCUMENT ME!
protected JMenuBarmenuBar
DOCUMENT ME!
static intNONE
static intPLAIN_DIALOG
static intQUESTION_DIALOG
static intWARNING_DIALOG
Constructor Summary
JRootPane()
Creates a new JRootPane object.
Method Summary
protected voidaddImpl(Component comp, Object constraints, int index)
DOCUMENT ME!
protected ContainercreateContentPane()
DOCUMENT ME!
protected ComponentcreateGlassPane()
DOCUMENT ME!
protected JLayeredPanecreateLayeredPane()
DOCUMENT ME!
protected LayoutManagercreateRootLayout()
DOCUMENT ME!
AccessibleContextgetAccessibleContext()
Returns the accessible context for this JRootPane.
ContainergetContentPane()
DOCUMENT ME!
JButtongetDefaultButton()
ComponentgetGlassPane()
DOCUMENT ME!
JMenuBargetJMenuBar()
DOCUMENT ME!
JLayeredPanegetLayeredPane()
DOCUMENT ME!
JMenuBargetMenuBar()
RootPaneUIgetUI()
DOCUMENT ME!
StringgetUIClassID()
DOCUMENT ME!
intgetWindowDecorationStyle()
booleanisOptimizedDrawingEnable()
This returns true if the glassPane is not visible because then the root pane can guarantee to tile its children (the only other direct child is a JLayeredPane which must figure its optimizeDrawingEnabled state on its own).
booleanisValidateRoot()
DOCUMENT ME!
voidsetContentPane(Container p)
Sets the JRootPane's content pane.
voidsetDefaultButton(JButton newButton)
voidsetGlassPane(Component f)
DOCUMENT ME!
voidsetJMenuBar(JMenuBar m)
DOCUMENT ME!
voidsetLayeredPane(JLayeredPane f)
Set the layered pane for the root pane.
voidsetMenuBar(JMenuBar m)
voidsetUI(RootPaneUI ui)
DOCUMENT ME!
voidsetWindowDecorationStyle(int style)
voidupdateUI()
DOCUMENT ME!

Field Detail

contentPane

protected Container contentPane
DOCUMENT ME!

COLOR_CHOOSER_DIALOG

public static final int COLOR_CHOOSER_DIALOG

defaultButton

protected JButton defaultButton

defaultPressAction

protected Action defaultPressAction

Deprecated: since JDK1.3

This field is unused since JDK1.3. To override the default action you should modify the JRootPane's ActionMap.

UNKNOWN: the specs indicate that the type of this field is a package private inner class javax.swing.JRootPane.DefaultAction. I assume that the closest public superclass is javax.swing.Action.

defaultReleaseAction

protected Action defaultReleaseAction

Deprecated: since JDK1.3

This field is unused since JDK1.3. To override the default action you should modify the JRootPane's ActionMap.

UNKNOWN: the specs indicate that the type of this field is a package private inner class javax.swing.JRootPane.DefaultAction. I assume that the closest public superclass is javax.swing.Action.

ERROR_DIALOG

public static final int ERROR_DIALOG

FILE_CHOOSER_DIALOG

public static final int FILE_CHOOSER_DIALOG

FRAME

public static final int FRAME

glassPane

protected Component glassPane
DOCUMENT ME!

INFORMATION_DIALOG

public static final int INFORMATION_DIALOG

layeredPane

protected JLayeredPane layeredPane
DOCUMENT ME!

menuBar

protected JMenuBar menuBar
DOCUMENT ME!

NONE

public static final int NONE

PLAIN_DIALOG

public static final int PLAIN_DIALOG

QUESTION_DIALOG

public static final int QUESTION_DIALOG

WARNING_DIALOG

public static final int WARNING_DIALOG

Constructor Detail

JRootPane

public JRootPane()
Creates a new JRootPane object.

Method Detail

addImpl

protected void addImpl(Component comp, Object constraints, int index)
DOCUMENT ME!

Parameters: comp DOCUMENT ME! constraints DOCUMENT ME! index DOCUMENT ME!

createContentPane

protected Container createContentPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

createGlassPane

protected Component createGlassPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

createLayeredPane

protected JLayeredPane createLayeredPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

createRootLayout

protected LayoutManager createRootLayout()
DOCUMENT ME!

Returns: DOCUMENT ME!

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the accessible context for this JRootPane. This will be an instance of {@link AccessibleJRootPane}.

Returns: the accessible context for this JRootPane

getContentPane

public Container getContentPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

getDefaultButton

public JButton getDefaultButton()

getGlassPane

public Component getGlassPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

getJMenuBar

public JMenuBar getJMenuBar()
DOCUMENT ME!

Returns: DOCUMENT ME!

getLayeredPane

public JLayeredPane getLayeredPane()
DOCUMENT ME!

Returns: DOCUMENT ME!

getMenuBar

public JMenuBar getMenuBar()

Deprecated: Replaced by getJMenuBar()

getUI

public RootPaneUI getUI()
DOCUMENT ME!

Returns: DOCUMENT ME!

getUIClassID

public String getUIClassID()
DOCUMENT ME!

Returns: DOCUMENT ME!

getWindowDecorationStyle

public int getWindowDecorationStyle()

Since: 1.4

isOptimizedDrawingEnable

public boolean isOptimizedDrawingEnable()
This returns true if the glassPane is not visible because then the root pane can guarantee to tile its children (the only other direct child is a JLayeredPane which must figure its optimizeDrawingEnabled state on its own).

Returns: true if the glassPane is not visible

isValidateRoot

public boolean isValidateRoot()
DOCUMENT ME!

Returns: DOCUMENT ME!

setContentPane

public void setContentPane(Container p)
Sets the JRootPane's content pane. The content pane should typically be opaque for painting to work properly. This method also removes the old content pane from the layered pane.

Parameters: p the Container that will be the content pane

Throws: IllegalComponentStateException if p is null

setDefaultButton

public void setDefaultButton(JButton newButton)

setGlassPane

public void setGlassPane(Component f)
DOCUMENT ME!

Parameters: f DOCUMENT ME!

setJMenuBar

public void setJMenuBar(JMenuBar m)
DOCUMENT ME!

Parameters: m DOCUMENT ME!

setLayeredPane

public void setLayeredPane(JLayeredPane f)
Set the layered pane for the root pane.

Parameters: f The JLayeredPane to be used.

Throws: IllegalComponentStateException if JLayeredPane parameter is null.

setMenuBar

public void setMenuBar(JMenuBar m)

Deprecated: Replaced by setJMenuBar()

setUI

public void setUI(RootPaneUI ui)
DOCUMENT ME!

Parameters: ui DOCUMENT ME!

setWindowDecorationStyle

public void setWindowDecorationStyle(int style)

Since: 1.4

updateUI

public void updateUI()
DOCUMENT ME!