|
||||||||||
| 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
, MenuContainer
, Serializable
, Accessible

, JDialog

public class Dialog

A Dialog is a top-level window with a title and a border
that is typically used to take some form of input from the user.
The size of the dialog includes any area designated for the
border. The dimensions of the border area can be obtained
using the getInsets method, however, since
these dimensions are platform-dependent, a valid insets
value cannot be obtained until the dialog is made displayable
by either calling pack or show.
Since the border area is included in the overall size of the
dialog, the border effectively obscures a portion of the dialog,
constraining the area available for rendering and/or displaying
subcomponents to the rectangle which has an upper-left corner
location of (insets.left, insets.top), and has a size of
width - (insets.left + insets.right) by
height - (insets.top + insets.bottom).
The default layout for a dialog is BorderLayout.
A dialog may have its native decorations (i.e. Frame & Titlebar) turned off
with setUndecorated. This can only be done while the dialog
is not displayable
.
A dialog must have either a frame or another dialog defined as its owner when it's constructed. When the owner window of a visible dialog is minimized, the dialog will automatically be hidden from the user. When the owner window is subsequently restored, the dialog is made visible to the user again.
In a multi-screen environment, you can create a Dialog
on a different screen device than its owner. See Frame
for
more information.
A dialog can be either modeless (the default) or modal. A modal dialog is one which blocks input to all other toplevel windows in the application, except for any windows created with the dialog as their owner.
Dialogs are capable of generating the following
WindowEvents:
WindowOpened, WindowClosing,
WindowClosed, WindowActivated,
WindowDeactivated, WindowGainedFocus,
WindowLostFocus.
WindowEvent
,
Window.addWindowListener(java.awt.event.WindowListener)
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
Dialog.AccessibleAWTDialog
This class implements accessibility support for the Dialog class. |
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 |
|---|
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
Dialog
Constructs an initially invisible, non-modal Dialog with an empty title and the specified owner dialog. |
|
Dialog
Constructs an initially invisible, non-modal Dialog with the specified owner dialog and title. |
|
Dialog
Constructs an initially invisible Dialog with the
specified owner dialog, title, and modality. |
|
Dialog
Constructs an initially invisible Dialog with the
specified owner dialog, title, modality, and
GraphicsConfiguration. |
|
Dialog
Constructs an initially invisible, non-modal Dialog with
an empty title and the specified owner frame. |
|
Dialog
Constructs an initially invisible Dialog with an empty title,
the specified owner frame and modality. |
|
Dialog
Constructs an initially invisible, non-modal Dialog with
the specified owner frame and title. |
|
Dialog
Constructs an initially invisible Dialog with the
specified owner frame, title, and modality. |
|
Dialog
Constructs an initially invisible Dialog with the specified owner frame, title, modality, and GraphicsConfiguration. |
|
| Method Summary | |
|---|---|
void |
addNotify
Makes this Dialog displayable by connecting it to a native screen resource. |
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this Dialog. |
String |
getTitle
Gets the title of the dialog. |
void |
hide
Deprecated. As of JDK version 1.5, replaced by Component.setVisible(boolean) . |
boolean |
isModal
Indicates whether the dialog is modal. |
boolean |
isResizable
Indicates whether this dialog is resizable by the user. |
boolean |
isUndecorated
Indicates whether this dialog is undecorated. |
protected String |
paramString
Returns a string representing the state of this dialog. |
void |
setModal
Specifies whether this dialog should be modal. |
void |
setResizable
Sets whether this dialog is resizable by the user. |
void |
setTitle
Sets the title of the Dialog. |
void |
setUndecorated
Disables or enables decorations for this dialog. |
void |
show
Deprecated. As of JDK version 1.5, replaced by Component.setVisible(boolean) . |
Methods inherited from class java.awt.Container ![]() |
|---|
add |