A JWindow is a container that can be displayed anywhere on the
user's desktop. It does not have the title bar, window-management buttons,
or other trimmings associated with a JFrame, but it is still a
"first-class citizen" of the user's desktop, and can exist anywhere
on it.
The JWindow component contains a JRootPane
as its only child. The contentPane should be the parent
of any children of the JWindow.
As a conveniance add and its variants, remove and
setLayout have been overridden to forward to the
contentPane as necessary. This means you can write:
window.add(child);
And the child will be added to the contentPane.
The contentPane will always be non-null.
Attempting to set it to null will cause the JWindow
to throw an exception. The default contentPane will have a
BorderLayout manager set on it.
Refer to RootPaneContainer
for details on adding, removing and setting the LayoutManager
of a JWindow.
Please see the JRootPane documentation for a complete description of
the contentPane, glassPane, and
layeredPane components.
In a multi-screen environment, you can create a JWindow
on a different screen device. See Window for more
information.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder .
JWindowis a container that can be displayed anywhere on the user's desktop. It does not have the title bar, window-management buttons, or other trimmings associated with aJFrame, but it is still a "first-class citizen" of the user's desktop, and can exist anywhere on it.The
JWindowcomponent contains aJRootPaneas its only child. ThecontentPaneshould be the parent of any children of theJWindow. As a convenianceaddand its variants,removeandsetLayouthave been overridden to forward to thecontentPaneas necessary. This means you can write:window.add(child);And the child will be added to the contentPane. ThecontentPanewill always be non-null. Attempting to set it tonullwill cause theJWindowto throw an exception. The defaultcontentPanewill have aBorderLayoutmanager set on it. Refer to RootPaneContainer for details on adding, removing and setting theLayoutManagerof aJWindow.Please see the JRootPane documentation for a complete description of the
contentPane,glassPane, andlayeredPanecomponents.In a multi-screen environment, you can create a
JWindowon a different screen device. See Window for more information.Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the
java.beanspackage. Please see XMLEncoder .