edu.southern.computing.oopj
Class GraphicalIO

java.lang.Object
  extended by edu.southern.computing.oopj.GraphicalIO

public class GraphicalIO
extends java.lang.Object


Constructor Summary
GraphicalIO()
           
 
Method Summary
static double nextDouble(java.lang.String prompt)
          Displays a dialog box and prompts the user with a given string.
static int nextInt(java.lang.String prompt)
          Displays a dialog box and prompts the user with a given string.
static java.lang.String nextString(java.lang.String prompt)
          Displays a dialog box and prompts the user with a given string.
static void showMessage(java.lang.String message)
          Displays a dialog box with a given message to the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicalIO

public GraphicalIO()
Method Detail

nextInt

public static int nextInt(java.lang.String prompt)
Displays a dialog box and prompts the user with a given string. The user is expected to provide an integer value. If the user provides text that cannot be parsed as an integer, an error dialog is displayed and zero is returned as the result.

Parameters:
prompt - The message to the user provided by the client code.
Returns:
The integer typed in by the user or zero if the user's input is not a valid integer value.

nextDouble

public static double nextDouble(java.lang.String prompt)
Displays a dialog box and prompts the user with a given string. The user is expected to provide a floating point value. If the user provides text that cannot be parsed as a floating point value, an error dialog is displayed and zero is returned as the result.

Parameters:
prompt - The message to the user provided by the client code.
Returns:
The floating point value typed in by the user or zero if the user's input is not a valid floating point value.

nextString

public static java.lang.String nextString(java.lang.String prompt)
Displays a dialog box and prompts the user with a given string. The text typed in by the user is returned.

Parameters:
prompt - The message to the user provided by the client code.
Returns:
The text typed in by the user.

showMessage

public static void showMessage(java.lang.String message)
Displays a dialog box with a given message to the user.

Parameters:
message - The message to the user provided by the client code.