Class Prompter

java.lang.Object
   |
   +----Prompter

public class Prompter
extends Object
Provides a dialog box prompt for user input of long and double values. The dialog is modal and does not return (unless specifically cancelled) until the user enters a valid value of the right type.

To use a Prompter, create one, passing it a Frame (NOT null). You then just call getLong, getDouble... supplying a prompt string that informs the user what is required. A dialog box will be put up with a button labeled with the type of data required. The user pushes this button when data have been added to the Reply field. The dialog will not accept illegal values. The cancel button will cancel the function and will return default values (zero).

Sources: Prompter.java


Constructor Index

 o Prompter(Frame)
Create a new Prompter.

Method Index

 o getDouble(String)
Prompt for and return a double value.
 o getLong(String)
Prompt for and return a long value.

Constructors

 o Prompter
 public Prompter(Frame parent)
Create a new Prompter.

Parameters:
parent - The Prompter's parent frame. Must not be null.

Methods

 o getLong
 public long getLong(String prompt)
Prompt for and return a long value.

Parameters:
prompt - A string to be shown in the dialog box to help the user.
Returns:
the long entered by the user.
 o getDouble
 public double getDouble(String prompt)
Prompt for and return a double value.

Parameters:
prompt - A string to be shown in the dialog box to help the user.
Returns:
the double entered by the user.