Package java.awt |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public class java.awt.Dialog extends java.awt.Window { // Constructors public Dialog(Frame parent, boolean modal); public Dialog(Frame parent, String title, boolean modal); // Methods public void addNotify(); public String getTitle(); public boolean isModal(); public boolean isResizable(); protected String paramString(); public void setResizable(boolean resizable); public void setTitle(String title); }
This class represents a dialog window, a window that takes input from the user.
Dialogs are intended to be temporary windows. They present specific timely information to the user, or they allow the user to specify options for the current operation.
The AWT sends the dialog window all mouse, keyboard, and focus events that occur over it.
By default, the dialog window is invisible. The application must use the show method to cause the dialog window to appear.
The default layout for a dialog is BorderLayout.
public Dialog(Frame parent, boolean modal)Creates a dialog window that is initially invisible. If the modal flag is true, the dialog window grabs all input from the user.
The parent argument is the main application window.
Parameter Description parent the owner of the dialog modal if true, the dialog box blocks input to other windows while it is visible
public Dialog(Frame parent, String title, boolean modal)Creates a titled dialog window that is initially invisible. If the modal flag is true, then the dialog box grabs all input from the user.
The parent argument is the main application window.
Parameter Description parent the owner of the dialog title the title of the dialog modal if true, dialog blocks input to other windows when shown
public void addNotify()This method calls the createDialog method of this object's toolkit in order to create a DialogPeer for this dialog window. This peer allows the application to change the look of a dialog window without changing its functionality.
Most applications do not call this method directly.
Overrides:
addNotify in class Window .
public String getTitle()Return Value:
Returns the title of this dialog window.
See Also: setTitle .
public boolean isModal()Return Value:
Returns true if this dialog window is modal; false otherwise.
public boolean isResizable()Indicates whether this dialog window is resizable. By default, a dialog window is resizable.
Return Value:
Returns true if the user can resize this dialog window; false otherwise.
protected String paramString()Returns the parameter string representing the state of this dialog window. This string is useful for debugging.
Return Value:
Returns the parameter string of this dialog window.
paramString in class Container .
public void setResizable(boolean resizable)Sets the resizable flag for this dialog window.
Parameter Description resizable true if this dialog window is resizable; false otherwise
public void setTitle(String title)Sets the title of this dialog window.
Parameter Description title the new title See Also: getTitle .