|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.kzoo.util.ValidatedInputReader2
Kalamazoo College Utility Classes:
This class prompts for input from the user and validates responses.
IT DOESN"T REALLY MAKE SENSE YET !!!
This class is incomplete, currently handling only integer input.
Furthermore, it is undoubtedly reinventing the wheel, but I haven't
had the time to do a search for a class that provides appropriate
validation.
Constructor Summary | |
ValidatedInputReader2()
|
Method Summary | |
int |
getInteger(javax.swing.JFrame parentFrame,
java.lang.String initialPrompt,
int startOfRange,
int endOfRange,
int suggestedValue,
java.lang.String clarificationPrompt)
Puts up a dialog box displaying the initialPrompt ,
waits for the user's response, and validates it (the response must
be a valid integer). |
int |
getInteger(javax.swing.JFrame parentFrame,
java.lang.String initialPrompt,
int suggestedValue,
java.lang.String clarificationPrompt)
Puts up a dialog box displaying the initialPrompt ,
waits for the user's response, and validates it (the response must
be a valid integer). |
int |
getInteger(java.lang.String initialPrompt,
int startOfRange,
int endOfRange,
int suggestedValue,
java.lang.String clarificationPrompt)
Puts up a dialog box displaying the initialPrompt ,
waits for the user's response, and validates it (the response must
be a valid integer). |
int |
getInteger(java.lang.String initialPrompt,
int suggestedValue,
java.lang.String clarificationPrompt)
Puts up a dialog box displaying the initialPrompt ,
waits for the user's response, and validates it (the response must
be a valid integer). |
void |
makeDialog(javax.swing.JFrame parent,
java.lang.String initialPrompt,
int startOfRange,
int endOfRange,
int suggestedValue,
java.lang.String clarificationPrompt)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ValidatedInputReader2()
Method Detail |
public int getInteger(java.lang.String initialPrompt, int suggestedValue, java.lang.String clarificationPrompt)
initialPrompt
,
waits for the user's response, and validates it (the response must
be a valid integer).
If the user's response is invalid, it prompts the user again
using the clarificationPrompt
until the user enters
a valid response or selects Cancel. If the user selects Cancel,
getInteger
returns the suggestedValue
.
initialPrompt
- the initial prompt to the usersuggestedValue
- a suggested, valid value that is displayed
to the user, and is also used as the default
value if the user selects CancelclarificationPrompt
- a follow-up prompt for input after
the user has input invalid datapublic int getInteger(javax.swing.JFrame parentFrame, java.lang.String initialPrompt, int suggestedValue, java.lang.String clarificationPrompt)
initialPrompt
,
waits for the user's response, and validates it (the response must
be a valid integer).
If the user's response is invalid, it prompts the user again
using the clarificationPrompt
until the user enters
a valid response or selects Cancel. If the user selects Cancel,
getInteger
returns the suggestedValue
.
parentFrame
- frame of application asking for inputinitialPrompt
- the initial prompt to the usersuggestedValue
- a suggested, valid value that is displayed
to the user, and is also used as the default
value if the user selects CancelclarificationPrompt
- a follow-up prompt for input after
the user has input invalid datapublic int getInteger(java.lang.String initialPrompt, int startOfRange, int endOfRange, int suggestedValue, java.lang.String clarificationPrompt)
initialPrompt
,
waits for the user's response, and validates it (the response must
be a valid integer).
If the user's response is invalid, it prompts the user again
using the clarificationPrompt
until the user enters
a valid response or selects Cancel. If the user selects Cancel,
getInteger
returns the suggestedValue
.
initialPrompt
- the initial prompt to the userstartOfRange
- the smallest value in the range of valid valuesendOfRange
- the largest value in the range of valid valuessuggestedValue
- a suggested, valid value that is displayed
to the user, and is also used as the default
value if the user selects CancelclarificationPrompt
- a follow-up prompt for input after
the user has input invalid datapublic int getInteger(javax.swing.JFrame parentFrame, java.lang.String initialPrompt, int startOfRange, int endOfRange, int suggestedValue, java.lang.String clarificationPrompt)
initialPrompt
,
waits for the user's response, and validates it (the response must
be a valid integer).
If the user's response is invalid, it prompts the user again
using the clarificationPrompt
until the user enters
a valid response or selects Cancel. If the user selects Cancel,
getInteger
returns the suggestedValue
.
parentFrame
- frame of application asking for inputinitialPrompt
- the initial prompt to the userstartOfRange
- the smallest value in the range of valid valuesendOfRange
- the largest value in the range of valid valuessuggestedValue
- a suggested, valid value that is displayed
to the user, and is also used as the default
value if the user selects CancelclarificationPrompt
- a follow-up prompt for input after
the user has input invalid datapublic void makeDialog(javax.swing.JFrame parent, java.lang.String initialPrompt, int startOfRange, int endOfRange, int suggestedValue, java.lang.String clarificationPrompt)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |