Java Reference
In-Depth Information
Table 8-1.
JRootPane Properties
Property Name
Data Type
Access
accessibleContext
AccessibleContext
Read-only
contentPane
Container
Read-write
defaultButton
JButton
Read-write bound
glassPane
Component
Read-write
jMenuBar
JMenuBar
Read-write
layeredPane
JLayeredPane
Read-write
optimizedDrawingEnabled
boolean
Read-only
UI
RootPaneUI
Read-write
UIClassID
String
Read-only
validateRoot
boolean
Read-only
windowDecorationStyle
int
Read-write bound
The
windowDecorationStyle
property is meant to describe the window adornments
(border, title, buttons for closing window) for the window containing the
JRootPane
. It can
be set to one of the following
JRootPane
class constants:
•
COLOR_CHOOSER_DIALOG
•
ERROR_DIALOG
•
FILE_CHOOSER_DIALOG
•
FRAME
•
INFORMATION_DIALOG
•
NONE
•
PLAIN_DIALOG
•
QUESTION_DIALOG
•
WARNING_DIALOG
What exactly happens with the
windowDecorationStyle
setting depends on the current
look and feel. It is just a hint. By default, this setting is
NONE
. If this setting is not
NONE
, the
setUndecorated()
method of
JDialog
or
JFrame
has been called with a value of
true
, and the
getSupportsWindowDecorations()
method of the current look and feel reports
true
, then the
look and feel, rather than the window manager, will provide the window adornments. This
allows you to have programs with top-level windows that look like they do not come from the
platform the user is working on but from your own environment, though still providing iconify,
maximize, minimize, and close buttons.