|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
public class Dialog
A dialog component is a top level window, . It resembles a frame, but has fewer properties. It does not have an icon or a settable cursor. In PersonalJava and Personal Profile implementations, the display of the title is optional.
A modal dialog, when visible, prevents the user from interacting with AWT components. A modeless dialog behaves more like a Frame. A Personal Profile Implementation must support modal dialogs. Multiple (nested) Modal Dialogs may be implemented so that only a single dialog is visible at a time: when a new modal is shown, it must become visible, and when it is dismissed, the previous modal dialog must be shown.
Nonmodal dialogs are optional in a Personal Profile implementation. If they are not supported, an UnsupportedOperationException is thrown when the consturctor is called and the system property java.awt.dialog.SupportsNonmodal is set to "false".
The modality of a dialog cannot be changed after the dialog has been created.
"true" or "false"
indicating which optional dialog features are supported by the Personal
Profile implementation:
WindowEvent,
Window.addWindowListener(java.awt.event.WindowListener),
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Dialog(Frame parent)
Creates a dialog. |
|
Dialog(Frame parent,
boolean modal)
Creates a dialog. |
|
Dialog(Frame parent,
String title)
Creates a dialog. |
|
Dialog(Frame parent,
String title,
boolean modal)
Creates a dialog. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes the Dialog and then causes show() to return if it is currently blocked. |
String |
getTitle()
Gets the title of the dialog. |
void |
hide()
Hides the Dialog and then causes show() to return if it is currently blocked. |
boolean |
isModal()
Indicates whether the dialog is modal. |
boolean |
isResizable()
Indicates whether this dialog window is resizable. |
protected String |
paramString()
Returns the parameter string representing the state of this dialog window. |
void |
setModal(boolean modal)
Specifies the modality of the dialog. |
void |
setResizable(boolean resizable)
Sets the Resizable property of the dialog. |
void |
setTitle(String title)
Sets the title of the Dialog. |
void |
show()
Makes this dialog visible and in front of all windows. |
| Methods inherited from class java.awt.Window |
|---|
addWindowListener, getFocusOwner, getGraphics, getInsets, getLocale, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, repaint, setBackground, setCursor, toBack, toFront, update, validate |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setLayout, validateTree |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Dialog(Frame parent)
parent - the non null parent of the dialog
UnsupportedOperationException - If the implementation does not support
modeless dialogs.
IllegalArgumentException - if the parent in nullComponent.setSize(int, int),
Component.setVisible(boolean)public Dialog(Frame parent, boolean modal)
parent - the non null parent of the dialogmodal - the modality of the dialog. If true the dialog is modal,
otherwise it is modeless. If the implementation does not
support modeless dialogs and modal is false, an
UnsupportedOperationException should be thrown.
UnsupportedOperationException - If the implementation does not support
modeless dialogs.
IllegalArgumentException - if the parent in nullComponent.setSize(int, int),
Component.setVisible(boolean)public Dialog(Frame parent, String title)
parent - the non null parent of the dialogtitle - the title of the dialog
UnsupportedOperationException - If the implementation does not support
modeless dialogs.
IllegalArgumentException - if the parent in nullComponent.setSize(int, int),
Component.setVisible(boolean)public Dialog(Frame parent, String title, boolean modal)
parent - the non null parent of the dialogtitle - the title of the dialogmodal - the modality of the dialog. If true the dialog is modal,
otherwise it is modeless. If the implementation does not
support modeless dialogs and modal is false, an
UnsupportedOperationException should be thrown.
UnsupportedOperationException - If the implementation does not support
modeless dialogs.
IllegalArgumentException - if the parent in nullComponent.setSize(int, int),
Component.setVisible(boolean)| Method Detail |
|---|
public boolean isModal()
true if this dialog window is modal;
false otherwise.setModal(boolean)public void setModal(boolean modal)
modal - desired modality for the dialogisModal()public String getTitle()
setTitle(java.lang.String)public void setTitle(String title)
title - the new title being given to the dialoggetTitle()public void show()
If the dialog is modal, show() will not return until the dialog is no longer visible.
A Personal Profile or Personal Java implementation is not required to support multiple modal dialogs. In this case, if there is a previous modal dialog being shown, it can be hidden until this Dialog is made invisible via setVisible() or dispose(). This must work recursively to allow for multiple nested modal dialogs.
Component.setVisible(boolean)public void hide()
public void dispose()
public boolean isResizable()
true if the user can resize the dialog;
false otherwise.setResizable(boolean)public void setResizable(boolean resizable)
resizable - true if the user can
resize this dialog; false otherwise.isResizable()protected String paramString()
paramString in class Container
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||