Java Reference
In-Depth Information
Table 8-2.
JRootPane UIResource Elements (Continued)
Property String
Object Type
RootPane.defaultButtonWindowKeyBindings
Object[ ]
RootPane.errorDialogBorder
Border
RootPane.fileChooserDialogBorder
Border
RootPane.frameBorder
Border
RootPane.informationDialogBorder
Border
RootPane.plainDialogBorder
Border
RootPane.questionDialogBorder
Border
RootPane.warningDialogBorder
Border
RootPaneUI
String
RootPaneContainer Interface
The
RootPaneContainer
interface defines the setter/getter methods for accessing the different
panes within the
JRootPane
, as well as accessing the
JRootPane
itself.
public interface RootPaneContainer {
// Properties
public Container getContentPane();
public void setContentPane(Container contentPane);
public Component getGlassPane();
public void setGlassPane(Component glassPane);
public JLayeredPane getLayeredPane();
public void setLayeredPane(JLayeredPane layeredPane);
public JRootPane getRootPane();
}
Among the predefined Swing components, the
JFrame
,
JWindow
,
JDialog
,
JApplet
, and
JInternalFrame
classes implement the
RootPaneContainer
interface. For the most part, these
implementations simply pass along the request to a
JRootPane
implementation for the high-
level container. The following source code is one such implementation for the glass pane of a
RootPaneContainer
implementer:
public Component getGlassPane() {
return getRootPane().getGlassPane();
}
public void setGlassPane(Component glassPane) {
getRootPane().setGlassPane(glassPane);
}
JLayeredPane Class
The
JLayeredPane
serves as the main component container of a
JRootPane
. The
JLayeredPane
manages the z-order, or layering, of components within itself. This ensures that the correct