Class AnswerDialog

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

public class AnswerDialog
extends Dialog
implements ActionListener
Class definition for a dialog which gets the answer to a question.

Version:
$Revision: 1.5 $, $Date: 2000/10/30 17:01:26 $
Author:
John Cavanaugh

Variable Index

 o frame
The parent frame.
 o textField
Text field to recieve the user's input.

Constructor Index

 o AnswerDialog(Frame, String, String[], String)
Constructs a dialog window.

Method Index

 o actionPerformed(ActionEvent)
Action for ActionListener interface; called when the user presses the OK button or the Enter key
 o getAnswer()
Gets the user's answer.
 o setLocation(int, int)
Sets the dialog's location, adding the parent frame's location to the given location.
 o setLocation(Point)
Sets the dialog's location, adding the parent frame's location to the given location.

Variables

 o frame
 protected Frame frame
The parent frame.

 o textField
 protected TextField textField
Text field to recieve the user's input.

Constructors

 o AnswerDialog
 public AnswerDialog(Frame frame,
                     String title,
                     String queryText[],
                     String defaultText)
Constructs a dialog window.

Parameters:
frame - The frame which the dialog is associated with.
title - A tile for the dialog window.
queryText - Text for the question the user is to answer.
defaultText - A default answer.

Methods

 o setLocation
 public void setLocation(Point loc)
Sets the dialog's location, adding the parent frame's location to the given location.

Parameters:
loc - The location for the window.
Overrides:
setLocation in class Component
 o setLocation
 public void setLocation(int x,
                         int y)
Sets the dialog's location, adding the parent frame's location to the given location.

Parameters:
x - The x offset of the window.
y - The y offset of the window.
Overrides:
setLocation in class Component
 o getAnswer
 public String getAnswer()
Gets the user's answer.

Returns:
The text that the user entered.
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Action for ActionListener interface; called when the user presses the OK button or the Enter key

Parameters:
e - The event which triggered the action.