Class SimpleInput

java.lang.Object
  extended by SimpleInput

public class SimpleInput
extends Object

Class to make it easy to get input from a user using JOptionPane Copyright Georgia Institute of Technology 2004

Author:
Barb Ericson ericson@cc.gatech.edu

Constructor Summary
SimpleInput()
           
 
Method Summary
static String getDirectory(String message)
          Method to get the name of a directory
static int getIntNumber(String message)
          Method to allow the user to input an integer.
static int getIntNumber(String message, int min, int max)
          Method to get an integer between a minimum and maximum (inclusive)
static double getNumber(String message)
          Method to allow the user to input a number.
static String getString(String message)
          Method to get a string input by the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleInput

public SimpleInput()
Method Detail

getNumber

public static double getNumber(String message)
Method to allow the user to input a number. the dialog will keep appearing till a valid number is input.

Parameters:
message - the message to display to the user in the dialog
Returns:
the number as a double

getIntNumber

public static int getIntNumber(String message)
Method to allow the user to input an integer. The dialog will keep appearing till a valid number is input.

Parameters:
message - the message to display to the user in the dialog
Returns:
the number as an integer

getIntNumber

public static int getIntNumber(String message,
                               int min,
                               int max)
Method to get an integer between a minimum and maximum (inclusive)

Parameters:
message - the message to display to
min - the minimum number
max - the maximum number
Returns:
the user entered integer

getDirectory

public static String getDirectory(String message)
Method to get the name of a directory

Parameters:
message - the message to display to the user
Returns:
the pathname for a directory

getString

public static String getString(String message)
Method to get a string input by the user. The dialog will keep appearing till a string is entered.

Parameters:
message - the message to display to the user
Returns:
the input string