All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.awt.Dialog

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Dialog
                                   |
                                   +----jp.kyasu.awt.Dialog

public class Dialog
extends Dialog
The Dialog class produces a dialog - a window that takes input from the user. The default layout for a dialog is BorderLayout.

If the JDK has the sun.awt.windows.WWindowPeer#getFocusPeer() bug (the JDK for Windows 95/NT version 1.1.4 or before), an application that uses the jp.kyasu.awt package should use this class instead of java.awt.Dialog.

Because of this bug, if a lightwight component is focus traversable, an application will be hung up.

Version:
15 May 1999
Author:
Kazuki YASUMATSU
See Also:
Dialog, HAS_FOCUS_BUG

Variable Index

 o CONFIRM
The confirm message type.
 o ERROR
The error message type.
 o INFORM
The inform message type.
 o MESSAGE
The normal message type.
 o WARN
The warn message type.

Constructor Index

 o Dialog(Frame)
Constructs an initially invisible Dialog with an empty title.
 o Dialog(Frame, boolean)
Constructs an initially invisible Dialog with an empty title.
 o Dialog(Frame, String)
Constructs an initially invisible Dialog with a title.
 o Dialog(Frame, String, boolean)
Constructs an initially invisible Dialog with a title.

Method Index

 o choice(int, Frame, String, String, String[], Object[], int)
Prompts a user to select a value from the specified values with a dialog.
 o choice(int, Frame, String, Visualizable, String[], Object[], int)
Prompts a user to select a value from the specified values with a dialog.
 o confirm(Frame, String)
Prompts a user to confirm the specified message with a dialog.
 o confirm(Frame, Visualizable)
Prompts a user to confirm the specified message with a dialog.
 o confirm(String)
Prompts a user to confirm the specified message with a dialog.
 o confirm(Visualizable)
Prompts a user to confirm the specified message with a dialog.
 o error(Frame, String)
Errors a user with a dialog.
 o error(Frame, Visualizable)
Errors a user with a dialog.
 o error(String)
Errors a user with a dialog.
 o error(Visualizable)
Errors a user with a dialog.
 o getErrorIcon()
Returns the error icon.
 o getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active.
 o getInformIcon()
Returns the information icon.
 o getQuestionIcon()
Returns the question icon.
 o getWarnIcon()
Returns the warning icon.
 o inform(Frame, String)
Informs a user with a dialog.
 o inform(Frame, Visualizable)
Informs a user with a dialog.
 o inform(String)
Informs a user with a dialog.
 o inform(Visualizable)
Informs a user with a dialog.
 o main(String[])
Executes the examples.
 o message(Frame, String)
Shows the message with a dialog.
 o message(Frame, String, String)
Shows the message with a dialog.
 o message(Frame, String, Visualizable)
Shows the message with a dialog.
 o message(Frame, Visualizable)
Shows the message with a dialog.
 o message(String)
Shows the message with a dialog.
 o message(Visualizable)
Shows the message with a dialog.
 o request(Frame, String)
Prompts a user to input a string with a dialog.
 o request(Frame, String, int)
Prompts a user to input a string with a dialog.
 o request(Frame, String, String)
Prompts a user to input a string with a dialog.
 o request(Frame, String, String, int)
Prompts a user to input a string with a dialog.
 o request(String)
Prompts a user to input a string with a dialog.
 o request(String, int)
Prompts a user to input a string with a dialog.
 o request(String, String)
Prompts a user to input a string with a dialog.
 o request(String, String, int)
Prompts a user to input a string with a dialog.
 o show()
Shows the dialog.
 o showKFCCopyright()
Shows the KFC copyright message with a dialog.
 o showKFCCopyright(Frame)
Shows the KFC copyright message with a dialog.
 o update(Graphics)
Updates this component.
 o warn(Frame, String)
Warns a user with a dialog.
 o warn(Frame, Visualizable)
Warns a user with a dialog.
 o warn(String)
Warns a user with a dialog.
 o warn(Visualizable)
Warns a user with a dialog.

Variables

 o MESSAGE
 public static final int MESSAGE
The normal message type.

 o INFORM
 public static final int INFORM
The inform message type.

 o WARN
 public static final int WARN
The warn message type.

 o ERROR
 public static final int ERROR
The error message type.

 o CONFIRM
 public static final int CONFIRM
The confirm message type.

Constructors

 o Dialog
 public Dialog(Frame parent)
Constructs an initially invisible Dialog with an empty title.

Parameters:
parent - the owner of the dialog.
 o Dialog
 public Dialog(Frame parent,
               boolean modal)
Constructs an initially invisible Dialog with an empty title. A modal Dialog grabs all the input to the parent frame from the user.

Parameters:
parent - the owner of the dialog.
modal - if true, dialog blocks input to the parent window when shown.
 o Dialog
 public Dialog(Frame parent,
               String title)
Constructs an initially invisible Dialog with a title.

Parameters:
parent - the owner of the dialog.
title - the title of the dialog.
 o Dialog
 public Dialog(Frame parent,
               String title,
               boolean modal)
Constructs an initially invisible Dialog with a title. A modal Dialog grabs all the input to the parent frame from the user.

Parameters:
parent - the owner of the dialog.
title - the title of the dialog.
modal - if true, dialog blocks input to the parent window when shown.

Methods

 o getInformIcon
 public VImage getInformIcon()
Returns the information icon.

 o getWarnIcon
 public VImage getWarnIcon()
Returns the warning icon.

 o getQuestionIcon
 public VImage getQuestionIcon()
Returns the question icon.

 o getErrorIcon
 public VImage getErrorIcon()
Returns the error icon.

 o request
 public static String request(String message)
Prompts a user to input a string with a dialog.

Parameters:
message - the message string shown in the dialog.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(String message,
                              String initialStr)
Prompts a user to input a string with a dialog.

Parameters:
message - the message string shown in the dialog.
initialStr - the initial inputted string.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(String message,
                              int columns)
Prompts a user to input a string with a dialog.

Parameters:
message - the message string shown in the dialog.
columns - the columns for the input text field.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(String message,
                              String initialStr,
                              int columns)
Prompts a user to input a string with a dialog.

Parameters:
message - the message string shown in the dialog.
initialStr - the initial inputted string.
columns - the columns for the input text field.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(Frame frame,
                              String message)
Prompts a user to input a string with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(Frame frame,
                              String message,
                              String initialStr)
Prompts a user to input a string with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
initialStr - the initial inputted string.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(Frame frame,
                              String message,
                              int columns)
Prompts a user to input a string with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
columns - the columns for the input text field.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o request
 public static String request(Frame frame,
                              String message,
                              String initialStr,
                              int columns)
Prompts a user to input a string with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
initialStr - the initial inputted string.
columns - the columns for the input text field.
Returns:
the inputted string, or an empty string if the dialog is canceled.
 o message
 public static void message(String message)
Shows the message with a dialog.

Parameters:
message - the message string shown in the dialog.
 o message
 public static void message(Visualizable message)
Shows the message with a dialog.

Parameters:
message - the visual message shown in the dialog.
 o message
 public static void message(Frame frame,
                            String message)
Shows the message with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
 o message
 public static void message(Frame frame,
                            String label,
                            String message)
Shows the message with a dialog.

Parameters:
frame - the owner of the dialog.
label - the label of the dialog.
message - the message string shown in the dialog.
 o message
 public static void message(Frame frame,
                            Visualizable message)
Shows the message with a dialog.

Parameters:
frame - the owner of the dialog.
message - the visual message shown in the dialog.
 o message
 public static void message(Frame frame,
                            String label,
                            Visualizable message)
Shows the message with a dialog.

Parameters:
frame - the owner of the dialog.
label - the label of the dialog.
message - the visual message shown in the dialog.
 o inform
 public static void inform(String message)
Informs a user with a dialog.

Parameters:
message - the message string shown in the dialog.
 o inform
 public static void inform(Visualizable message)
Informs a user with a dialog.

Parameters:
message - the visual message shown in the dialog.
 o inform
 public static void inform(Frame frame,
                           String message)
Informs a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
 o inform
 public static void inform(Frame frame,
                           Visualizable message)
Informs a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the visual message shown in the dialog.
 o warn
 public static void warn(String message)
Warns a user with a dialog.

Parameters:
message - the message string shown in the dialog.
 o warn
 public static void warn(Visualizable message)
Warns a user with a dialog.

Parameters:
message - the visual message shown in the dialog.
 o warn
 public static void warn(Frame frame,
                         String message)
Warns a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
 o warn
 public static void warn(Frame frame,
                         Visualizable message)
Warns a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the visual message shown in the dialog.
 o error
 public static void error(String message)
Errors a user with a dialog.

Parameters:
message - the message string shown in the dialog.
 o error
 public static void error(Visualizable message)
Errors a user with a dialog.

Parameters:
message - the visual message shown in the dialog.
 o error
 public static void error(Frame frame,
                          String message)
Errors a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
 o error
 public static void error(Frame frame,
                          Visualizable message)
Errors a user with a dialog.

Parameters:
frame - the owner of the dialog.
message - the visual message shown in the dialog.
 o confirm
 public static boolean confirm(String message)
Prompts a user to confirm the specified message with a dialog.

Parameters:
message - the message string shown in the dialog.
Returns:
true if confirmed, or false otherwise.
 o confirm
 public static boolean confirm(Visualizable message)
Prompts a user to confirm the specified message with a dialog.

Parameters:
message - the visual message shown in the dialog.
Returns:
true if confirmed, or false otherwise.
 o confirm
 public static boolean confirm(Frame frame,
                               String message)
Prompts a user to confirm the specified message with a dialog.

Parameters:
frame - the owner of the dialog.
message - the message string shown in the dialog.
Returns:
true if confirmed, or false otherwise.
 o confirm
 public static boolean confirm(Frame frame,
                               Visualizable message)
Prompts a user to confirm the specified message with a dialog.

Parameters:
frame - the owner of the dialog.
message - the visual message shown in the dialog.
Returns:
true if confirmed, or false otherwise.
 o choice
 public static Object choice(int type,
                             Frame frame,
                             String title,
                             String message,
                             String labels[],
                             Object values[],
                             int defaultIndex)
Prompts a user to select a value from the specified values with a dialog.

Parameters:
type - the dialog type.
frame - the owner of the dialog.
title - the title of the dialog.
message - the message string shown in the dialog.
labels - the labels associated with the values.
values - the values.
defaultIndex - the default selected index of the values.
Returns:
the selected value, or null if the dialog is canceled.
 o choice
 public static Object choice(int type,
                             Frame frame,
                             String title,
                             Visualizable message,
                             String labels[],
                             Object values[],
                             int defaultIndex)
Prompts a user to select a value from the specified values with a dialog.

Parameters:
type - the dialog type.
frame - the owner of the dialog.
title - the title of the dialog.
message - the visual message shown in the dialog.
labels - the labels associated with the values.
values - the values.
defaultIndex - the default selected index of the values.
Returns:
the selected value, or null if the dialog is canceled.
 o showKFCCopyright
 public static void showKFCCopyright()
Shows the KFC copyright message with a dialog.

 o showKFCCopyright
 public static void showKFCCopyright(Frame frame)
Shows the KFC copyright message with a dialog.

Parameters:
frame - the owner of the dialog.
 o update
 public void update(Graphics g)
Updates this component.

Overrides:
update in class Container
 o getFocusOwner
 public Component getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active.

Returns:
the component with focus, or null if no children have focus assigned to them.
Overrides:
getFocusOwner in class Window
See Also:
HAS_FOCUS_BUG
 o show
 public void show()
Shows the dialog. This will bring the dialog to the front if the dialog is already visible.

Overrides:
show in class Dialog
 o main
 public static void main(String arg[])
Executes the examples.


All Packages  Class Hierarchy  This Package  Previous  Next  Index