Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display message if input is alpha character?

Status
Not open for further replies.

R17

Programmer
Jan 20, 2003
267
0
0
PH


i'm asking input from users of type integer... but when my user types alpha characters... i get an error...

i want to display a message telling my users only numbers are acceptable?
 

try {
int i = Integer.parseInt(inputFromUser);
} catch(NumberFormatException nfe) {
// user did not enter integer, do something here.
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top