|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jwo.utils.KeyboardInput
Class to handle keyboard input. Can prompt for user input using both standard input and graphical prompt; convert input string into numbers; and pick up conversion errors.
Constructor Summary | |
KeyboardInput()
Creates a keyboardInput object that handles prompting and conversion of keyboard input. |
Method Summary | |
char |
getChar()
Extracts the first letter of a string typed in on the keyboard. |
double |
getDouble()
Extracts a double precision number from the keyboard input. |
float |
getFloat()
Extracts a floating point number from the keyboard input. |
int |
getInt()
Extracts an integer number from the keyboard input. |
String |
getString()
Extracts a string typed in on the keyboard. |
void |
prompt(String promptText)
Prompts the user to type in something from the keyboard. |
void |
prompt(String windowTitle,
String promptText)
Prompts the user to type in something from the keyboard. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KeyboardInput()
Method Detail |
public void prompt(String promptText)
promptText
- Message to prompt input with.public void prompt(String windowTitle, String promptText)
windowTitle
- Title of input window.promptText
- Message to prompt input with.public int getInt()
public float getFloat()
public double getDouble()
public String getString()
public char getChar()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |