|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
java.awt.Window
![]()
![]()
![]()
java.awt.Dialog
![]()
![]()
![]()
javax.swing.JDialog
, MenuContainer
, Serializable
, Accessible
, RootPaneContainer
, WindowConstants

public class JDialog

, Accessible
, RootPaneContainer

The main class for creating a dialog window. You can use this class
to create a custom dialog, or invoke the many class methods
in JOptionPane
to create a variety of standard dialogs.
For information about creating dialogs, see
The Java Tutorial section
How
to Make Dialogs.
The JDialog component contains a JRootPane
as its only child.
The contentPane should be the parent of any children of the
JDialog.
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:
dialog.add(child);
And the child will be added to the contentPane.
The contentPane is always non-null.
Attempting to set it to null generates an exception.
The default contentPane has a BorderLayout
manager set on it.
Refer to RootPaneContainer
for details on adding, removing and setting the LayoutManager
of a JDialog.
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 JDialog
on a different screen device than its owner. See Frame
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
.
JOptionPane
,
JRootPane
,
RootPaneContainer
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
JDialog.AccessibleJDialog
This class implements accessibility support for the JDialog class. |
Nested classes/interfaces inherited from class java.awt.Dialog ![]() |
|---|
Dialog.AccessibleAWTDialog |
Nested classes/interfaces inherited from class java.awt.Window ![]() |
|---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
protected AccessibleContext |
accessibleContext
|
protected JRootPane |
rootPane
|
protected boolean |
rootPaneCheckingEnabled
If true then calls to add and setLayout
will be forwarded to the contentPane. |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants ![]() |
|---|
DISPOSE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JDialog
Creates a non-modal dialog without a title and without a specified Frame owner. |
|
JDialog
Creates a non-modal dialog without a title with the specified Dialog as its owner. |
|
JDialog
Creates a modal or non-modal dialog without a title and with the specified owner dialog. |
|
JDialog
Creates a non-modal dialog with the specified title and with the specified owner dialog. |
|
JDialog
Creates a modal or non-modal dialog with the specified title and the specified owner frame. |
|
JDialog
Creates a modal or non-modal dialog with the specified title, owner Dialog, and GraphicsConfiguration. |
|
JDialog
Creates a non-modal dialog without a title with the specified Frame as its owner. |
|
JDialog
Creates a modal or non-modal dialog without a title and with the specified owner Frame. |
|
JDialog
Creates a non-modal dialog with the specified title and with the specified owner frame. |
|
JDialog
Creates a modal or non-modal dialog with the specified title and the specified owner Frame. |
|
JDialog
Creates a modal or non-modal dialog with the specified title, owner Frame, and GraphicsConfiguration. |
|
| Method Summary | |
|---|---|
protected void |
addImpl
Adds the specified child Component. |
protected JRootPane |
createRootPane
Called by the constructor methods to create the default rootPane. |
protected void |
dialogInit
Called by the constructors to init the JDialog properly. |
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this JDialog. |
Container |
getContentPane
Returns the contentPane object for this dialog. |
int |
getDefaultCloseOperation
Returns the operation which occurs when the user initiates a "close" on this dialog. |
Component |
getGlassPane
Returns the glassPane object for this dialog. |
JMenuBar |
getJMenuBar
Returns the menubar set on this dialog. |
JLayeredPane |
getLayeredPane
Returns the layeredPane object for this dialog. |
JRootPane |
getRootPane
Returns the rootPane object for this dialog. |
static boolean |
isDefaultLookAndFeelDecorated
Returns true if newly created JDialogs should have their
Window decorations provided by the current look and feel. |
protected boolean |
isRootPaneCheckingEnabled
Returns whether calls to add and
setLayout are forwarded to the contentPane. |
protected String |
paramString
Returns a string representation of this JDialog. |
protected void |
processWindowEvent
Handles window events depending on the state of the defaultCloseOperation property. |
void |
remove
Removes the specified component from the container. |
void |
setContentPane
Sets the contentPane property. |
void |
setDefaultCloseOperation
Sets the operation which will happen by default when the user initiates a "close" on this dialog. |
static void |
setDefaultLookAndFeelDecorated
Provides a hint as to whether or not newly created JDialogs
should have their Window decorations (such as borders, widgets to
close the window, title...) provided by the current look
and feel. |
void |
setGlassPane
Sets the glassPane property. |
void |
setJMenuBar
Sets the menubar for this dialog. |
void |
setLayeredPane
Sets the layeredPane property. |
void |
setLayout
Sets the LayoutManager. |
protected void |
setRootPane
Sets the rootPane property. |
protected void |
setRootPaneCheckingEnabled
Sets whether calls to add and
setLayout are forwarded to the contentPane. |
void |
update
Calls paint(g). |
Methods inherited from class java.awt.Dialog ![]() |
|---|
addNotify |
Methods inherited from class java.awt.Window ![]() |
|---|
addPropertyChangeListener |