| public class java.awt Dialog
|
Java SE 6 |
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.awt.Frame 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.
| version | 1.125, 06/21/06 |
| since | JDK1.0 |
| See also | java.awt.event.WindowEvent, addWindowListener |
| Fields | |||||
|---|---|---|---|---|---|
| final public static Dialog.ModalityType | DEFAULT_MODALITY_TYPE Details
Default modality type for modal dialogs. The default modality type is
APPLICATION_MODAL. Calling the oldstyle setModal(true)
is equal to setModalityType(DEFAULT_MODALITY_TYPE).
| ||||
| Constructors | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public | Dialog(Frame owner) Details
Constructs an initially invisible, modeless Dialog with
the specified owner Frame and an empty title.
| ||||||||||||||||||||
| public | Dialog(Frame owner, boolean modal) Details
Constructs an initially invisible Dialog with the specified
owner Frame and modality and an empty title.
| ||||||||||||||||||||
| public | Dialog(Frame owner, String title) Details
Constructs an initially invisible, modeless Dialog with
the specified owner Frame and title.
| ||||||||||||||||||||
| public | Dialog(Frame owner, String title, boolean modal) Details
Constructs an initially invisible Dialog with the
specified owner Frame, title and modality.
| ||||||||||||||||||||
| public | Dialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) Details
Constructs an initially invisible Dialog with the specified owner
Frame, title, modality, and GraphicsConfiguration.
| ||||||||||||||||||||
| public | Dialog(Dialog owner) Details
Constructs an initially invisible, modeless Dialog with
the specified owner Dialog and an empty title.
| ||||||||||||||||||||
| public | Dialog(Dialog owner, String title) Details
Constructs an initially invisible, modeless Dialog
with the specified owner Dialog and title.
| ||||||||||||||||||||
| public | Dialog(Dialog owner, String title, boolean modal) Details
Constructs an initially invisible Dialog with the
specified owner Dialog, title, and modality.
| ||||||||||||||||||||
| public | Dialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc) Details
Constructs an initially invisible Dialog with the
specified owner Dialog, title, modality and
GraphicsConfiguration.
| ||||||||||||||||||||
| public | Dialog(Window owner) Details
Constructs an initially invisible, modeless Dialog with the
specified owner Window and an empty title.
| ||||||||||||||||||||
| public | Dialog(Window owner, String title) Details
Constructs an initially invisible, modeless Dialog with
the specified owner Window and title.
| ||||||||||||||||||||
| public | Dialog(Window owner, Dialog.ModalityType modalityType) Details
Constructs an initially invisible Dialog with the
specified owner Window and modality and an empty title.
| ||||||||||||||||||||
| public | Dialog(Window owner, String title, Dialog.ModalityType modalityType) Details
Constructs an initially invisible Dialog with the
specified owner Window, title and modality.
| ||||||||||||||||||||
| public | Dialog(Window owner, String title, Dialog.ModalityType modalityType, GraphicsConfiguration gc) Details
Constructs an initially invisible Dialog with the
specified owner Window, title, modality and
GraphicsConfiguration.
| ||||||||||||||||||||
| Methods | |||||
|---|---|---|---|---|---|
| public void | addNotify() Details
Makes this Dialog displayable by connecting it to
a native screen resource. Making a dialog displayable will
cause any of its children to be made displayable.
This method is called internally by the toolkit and should
not be called directly by programs.
| ||||
| public void | hide() Details
Hides the Dialog and then causes show to return if it is currently
blocked.
| ||||
| protected String | paramString() Details
Returns a string representing the state of this dialog. This
method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null.
| ||||
| public void | show() Details
Makes the Dialog visible. 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 the dialog is already visible, this will bring the dialog
to the front.
If the dialog is modal and is not already visible, this call will not return until the dialog is hidden by calling hide or dispose. It is permissible to show modal dialogs from the event dispatching thread because the toolkit will ensure that another event pump runs while the one which invoked this method is blocked.
| ||||
| public void | toBack() Details
If this Window is visible, sends this Window to the back and may cause
it to lose focus or activation if it is the focused or active Window.
Places this Window at the bottom of the stacking order and shows it behind any other Windows in this VM. No action will take place is this Window is not visible. Some platforms do not allow Windows which are owned by other Windows to appear below their owners. Every attempt will be made to move this Window as low as possible in the stacking order; however, developers should not assume that this method will move this Window below all other windows in every situation. Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is no longer the focused or active Window until this Window receives a WINDOW_LOST_FOCUS or WINDOW_DEACTIVATED event. On platforms where the top-most window is the focused window, this method will probably cause this Window to lose focus. In that case, the next highest, focusable Window in this VM will receive focus. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged. If this dialog is modal and blocks some windows, then all of them are also sent to the back to keep them below the blocking dialog.
| ||||
| Properties | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| public AccessibleContext | getAccessibleContext() Details
Gets the AccessibleContext associated with this Dialog.
For dialogs, the AccessibleContext takes the form of an
AccessibleAWTDialog.
A new AccessibleAWTDialog instance is created if necessary.
| ||||||||
| public void | setModal(boolean modal) Details
Specifies whether this dialog should be modal.
This method is obsolete and is kept for backwards compatibility only.
Use Note: changing modality of the visible dialog may have no effect until it is hidden and then shown again.
| ||||||||
| public boolean | isModal() Details
Indicates whether the dialog is modal.
This method is obsolete and is kept for backwards compatiblity only.
Use
| ||||||||
| public void | setModalityType(Dialog.ModalityType type) Details
Sets the modality type for this dialog. See ModalityType for possible modality types.
If the given modality type is not supported, Note: changing modality of the visible dialog may have no effect until it is hidden and then shown again.
| ||||||||
| public Dialog.ModalityType | getModalityType() Details
Returns the modality type of this dialog.
| ||||||||
| public void | setResizable(boolean resizable) Details
Sets whether this dialog is resizable by the user.
| ||||||||
| public boolean | isResizable() Details
Indicates whether this dialog is resizable by the user.
By default, all dialogs are initially resizable.
| ||||||||
| public void | setTitle(String title) Details
Sets the title of the Dialog.
| ||||||||
| public String | getTitle() Details
Gets the title of the dialog. The title is displayed in the
dialog's border.
| ||||||||
| public void | setUndecorated(boolean undecorated) Details
Disables or enables decorations for this dialog.
This method can only be called while the dialog is not displayable.
| ||||||||
| public boolean | isUndecorated() Details
Indicates whether this dialog is undecorated.
By default, all dialogs are initially decorated.
| ||||||||
| public void | setVisible(boolean b) Details
Shows or hides this Dialog depending on the value of parameter
b.
| ||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2013 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|