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 may have another window 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 java.
for
more information.
A dialog can be either modeless (the default) or modal. A modal dialog is one which blocks input to some other top-level windows in the application, except for any windows created with the dialog as their owner. See AWT Modality specification for details.
Dialogs are capable of generating the following
WindowEvents
:
WindowOpened
, WindowClosing
,
WindowClosed
, WindowActivated
,
WindowDeactivated
, WindowGainedFocus
,
WindowLostFocus
.
WindowEvent
, Window#addWindowListener
Modifier and Type | Class and Description |
---|---|
protected class | Dialog.
This class implements accessibility support for the
|
public static enum | Dialog.
Any top-level window can be marked not to be blocked by modal dialogs. |
public static enum | Dialog.
Modal dialogs block all input to some top-level windows. |
Modifier and Type | Field and Description |
---|---|
private static final String | base
Hides java. |
pack-priv transient IdentityArrayList | |
public static final Dialog. | DEFAULT_MODALITY_TYPE
Default modality type for modal dialogs. |
private transient boolean | |
pack-priv transient volatile boolean | |
pack-priv transient volatile boolean | |
pack-priv boolean | modal
True if this dialog is modal, false is the dialog is modeless. |
pack-priv static transient IdentityArrayList | |
private transient ModalEventFilter | |
pack-priv Dialog. | modalityType
Modality type of this dialog. |
private static int | |
pack-priv boolean | resizable
A dialog's resizable property. |
private transient volatile SecondaryLoop | |
private static final long | serialVersionUID
Use serialVersionUID from JDK 1.1 for interoperability.
|
pack-priv String | title
Specifies the title of the Dialog. |
pack-priv boolean | undecorated
This field indicates whether the dialog is undecorated. |
Access | Constructor and Description |
---|---|
public | |
public | Dialog(Frame
the owner of the dialog or owner, boolean null if
this dialog has no ownerspecifies whether dialog blocks user input to other top-level
windows when shown. If modal)false , the dialog is MODELESS ;
if true , the modality type property is set to
DEFAULT_MODALITY_TYPE Constructs an initially invisible |
public | |
public | Dialog(Frame
the owner of the dialog or owner, String null if
this dialog has no ownerthe title of the dialog or title, boolean null if this dialog
has no titlespecifies whether dialog blocks user input to other top-level
windows when shown. If modal)false , the dialog is MODELESS ;
if true , the modality type property is set to
DEFAULT_MODALITY_TYPE Constructs an initially invisible |
public | Dialog(Frame
the owner of the dialog or owner, String null if this dialog
has no ownerthe title of the dialog or title, boolean null if this dialog
has no titlespecifies whether dialog blocks user input to other top-level
windows when shown. If modal, GraphicsConfiguration false , the dialog is MODELESS ;
if true , the modality type property is set to
DEFAULT_MODALITY_TYPE the gc)GraphicsConfiguration of the target screen device;
if null , the default system GraphicsConfiguration
is assumedConstructs an initially invisible |
public | |
public | |
public | Dialog(Dialog
the owner of the dialog or owner, String null if this
dialog has no ownerthe title of the dialog or title, boolean null if this
dialog has no titlespecifies whether dialog blocks user input to other top-level
windows when shown. If modal)false , the dialog is MODELESS ;
if true , the modality type property is set to
DEFAULT_MODALITY_TYPE Constructs an initially invisible |
public | Dialog(Dialog
the owner of the dialog or owner, String null if this
dialog has no ownerthe title of the dialog or title, boolean null if this
dialog has no titlespecifies whether dialog blocks user input to other top-level
windows when shown. If modal, GraphicsConfiguration false , the dialog is MODELESS ;
if true , the modality type property is set to
DEFAULT_MODALITY_TYPE the gc)GraphicsConfiguration of the target screen device;
if null , the default system GraphicsConfiguration
is assumedConstructs an initially invisible |
public | |
public | |
public | Dialog(Window owner, Dialog.
specifies whether dialog blocks input to other
windows when shown. modalityTypenull value and unsupported modality
types are equivalent to MODELESS Constructs an initially invisible |
public | Dialog(Window owner, String
the title of the dialog or title, Dialog.null if this dialog
has no titlespecifies whether dialog blocks input to other
windows when shown. modalityTypenull value and unsupported modality
types are equivalent to MODELESS Constructs an initially invisible |
public | Dialog(Window owner, String
the title of the dialog or title, Dialog.null if this dialog
has no titlespecifies whether dialog blocks input to other
windows when shown. modalityType,null value and unsupported modality
types are equivalent to MODELESS the gc)GraphicsConfiguration of the target screen device;
if null , the default system GraphicsConfiguration
is assumedConstructs an initially invisible |
Modifier and Type | Method and Description |
---|---|
public void | addNotify()
Overrides java. |
pack-priv void | |
pack-priv void | |
private void | |
pack-priv static void | |
private boolean | Returns: true if we actually showed, false if we just called toFront()
|
pack-priv String | constructComponentName()
Overrides java. |
pack-priv void | doDispose()
Overrides java. |
public AccessibleContext | Returns: an AccessibleAWTDialog that serves as the AccessibleContext of this DialogOverrides java. Implements javax. |
public Dialog. | |
public String | Returns: the title of this dialog window. The title may benull .Gets the title of the dialog. |
public void | hide()
Overrides java.
Deprecated
As of JDK version 1.5, replaced by
Hides the Dialog and then causes setVisible(boolean) .
show to return if it is currently
blocked.
|
private void | |
private void | |
private static native void | |
public boolean | Returns: true if this dialog window is modal;
false otherwiseIndicates whether the dialog is modal. |
pack-priv final boolean | |
public boolean | Returns: true if the user can resize the dialog;
false otherwise.Indicates whether this dialog is resizable by the user. |
public boolean | Returns: true if dialog is undecorated;
false otherwise.Indicates whether this dialog is undecorated. |
pack-priv void | |
pack-priv final void | |
pack-priv final void | |
pack-priv void | |
protected String | Returns: the parameter string of this dialog window.Overrides java. |
private void | readObject(ObjectInputStream
the s)ObjectInputStream to readHides java. |
public void | setBackground(Color
the color to become this window's background color. bgColor)Overrides java. |
public void | setModal(boolean
specifies whether dialog blocks input to other windows
when shown; calling to modal)setModal(true) is equivalent to
setModalityType(Dialog.DEFAULT_MODALITY_TYPE) , and
calling to setModal(false) is equivalent to
setModalityType(Dialog.ModalityType.MODELESS) Specifies whether this dialog should be modal. |
public void | setModalityType(Dialog.
specifies whether dialog blocks input to other
windows when shown. typenull value and unsupported modality
types are equivalent to MODELESS Sets the modality type for this dialog. |
public void | setOpacity(float
the opacity level to set to the window opacity)Overrides java. |
public void | setResizable(boolean
true if the user can
resize this dialog; false otherwise.Sets whether this dialog is resizable by the user. |
public void | setShape(Shape
the shape to set to the window shape)Overrides java. |
public void | |
public void | setUndecorated(boolean
true if no dialog decorations are to be
enabled; false if dialog decorations are to be enabledDisables or enables decorations for this dialog. |
public void | setVisible(boolean
if b)true , makes the Dialog visible,
otherwise hides the Dialog .
If the dialog and/or its owner
are not yet displayable, both are made displayable. The
dialog will be validated prior to being made visible.
If false , hides the Dialog and then causes setVisible(true)
to return if it is currently blocked.
Notes for modal dialogs.
Overrides java. Dialog depending on the value of parameter
b .
|
pack-priv boolean | |
public void | show()
Overrides java.
Deprecated
As of JDK version 1.5, replaced by
Makes the setVisible(boolean) .
Dialog visible.
|
public void | toBack()
Overrides java. |
pack-priv void |