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 convenience, the {@code add}, {@code remove}, and {@code setLayout}methods of this class are overridden, so that they delegate calls to the corresponding methods of the {@code ContentPane}. For example, you can add a child component to a window as follows:
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 {@link javax.swing.RootPaneContainer}for details on adding, removing and setting the
LayoutManager
of a
JWindow
.
Please see the {@link JRootPane} documentation for a complete description ofthe contentPane
, glassPane
, and layeredPane
components.
In a multi-screen environment, you can create a JWindow
on a different screen device. See {@link java.awt.Window} for moreinformation.
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 JavaBeans™ has been added to the java.beans
package. Please see {@link java.beans.XMLEncoder}.
@see JRootPane
@beaninfo attribute: isContainer true attribute: containerDelegate getContentPane description: A toplevel window which has no system border or controls.
@author David Kloba