Packages This Package Prev Next Index
§1.12 Class Dialog
public class java.awt.Dialog
extends java.awt.Window (II-§1.42)
{
// Constructors
public Dialog(Frame parent, boolean modal); §1.12.1
public Dialog(Frame parent, String title, §1.12.2
boolean modal);
// Methods
public void addNotify(); §1.12.3
public String getTitle(); §1.12.4
public boolean isModal(); §1.12.5
public boolean isResizable(); §1.12.6
protected String paramString(); §1.12.7
public void setResizable(boolean resizable); §1.12.8
public void setTitle(String title); §1.12.9
}
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
(II-§1.10.70) to cause the dialog window to appear.
The default layout for a dialog is BorderLayout.
Dialog
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.
- Parameters:
parent
-
the owner of the dialog
modal
-
if true, the dialog box blocks input to other windows while it is
visible
Dialog
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.
- Parameters:
parent
-
the owner of the dialog
title
-
the title of the dialog
modal
-
if true, dialog blocks input to other windows when shown
addNotify
public void addNotify()
- This method calls the createDialog method (II-§1.41.8) of this object's toolkit (II-§1.10.20) in order to create a DialogPeer (II-§3.8) 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 (II-§1.42.2).
getTitle
public String getTitle()
- Returns:
- the title of this dialog window.
- See Also:
- setTitle (II-§1.12.9).
isModal
public boolean isModal()
- Returns:
- true if this dialog window is modal; false otherwise.
isResizable
public boolean isResizable()
- Indicates whether this dialog window is resizable. By default, a dialog
window is resizable.
- Returns:
- true if the user can resize this dialog window; false otherwise.
paramString
protected String paramString()
- Returns the parameter string representing the state of this dialog window.
This string is useful for debugging.
- Returns:
- the parameter string of this dialog window.
- Overrides:n
- paramString in class Container (II-§1.11.16).
setResizable
public void setResizable(boolean resizable)
- Sets the resizable flag for this dialog window.
- Parameters:
resizable
-
true if this dialog window is resizable; false otherwise
setTitle
public void setTitle(String title)
- Sets the title of this dialog window.
- Parameters:
title
-
the new title
- See Also:
- getTitle (II-§1.12.4).
Packages This Package Prev Next Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com