The main class for creating a dialog window. You can use this class
to create a custom dialog, or invoke the many class methods
JOptionPane to create a variety of standard dialogs.
For information about creating dialogs, see
The Java Tutorial section
to Make Dialogs.
JDialog component contains a
as its only child.
contentPane should be the parent of any children of the
As a convenience, the
methods of this class are overridden, so that they delegate calls
to the corresponding methods of the
For example, you can add a child component to a dialog as follows:
dialog.add(child);And the child will be added to the contentPane. The
contentPaneis always non-
null. Attempting to set it to
nullgenerates an exception. The default
BorderLayoutmanager set on it. Refer to
javax.swing.RootPaneContainerfor details on adding, removing and setting the
Please see the
JRootPane documentation for a complete
description of the
In a multi-screen environment, you can create a
on a different screen device than its owner. See
Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
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