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
-
frame
- The parent frame.
-
textField
- Text field to recieve the user's input.
-
AnswerDialog(Frame, String, String[], String)
- Constructs a dialog window.
-
actionPerformed(ActionEvent)
- Action for ActionListener interface; called when the user
presses the OK button or the Enter key
-
getAnswer()
- Gets the user's answer.
-
setLocation(int, int)
- Sets the dialog's location, adding the parent frame's location
to the given location.
-
setLocation(Point)
- Sets the dialog's location, adding the parent frame's location
to the given location.
frame
protected Frame frame
- The parent frame.
textField
protected TextField textField
- Text field to recieve the user's input.
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.
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
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
getAnswer
public String getAnswer()
- Gets the user's answer.
- Returns:
- The text that the user entered.
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.