try
{
i= Integer.parseInt( iVal );
}
catch(NumberFormatException e)
{
//JOption error message
}
Is this the correct code? i is an int that equals an input screen. The user must enter 1,2,3,4 or 5. I need to just show an error message if the user enters say a "wjfjf" or anything other than the correct numbers. Is this right? Thanks
...and what does that magical "e" mean? I compiled without that e and got like 7 errors. With it I got none.
{
i= Integer.parseInt( iVal );
}
catch(NumberFormatException e)
{
//JOption error message
}
Is this the correct code? i is an int that equals an input screen. The user must enter 1,2,3,4 or 5. I need to just show an error message if the user enters say a "wjfjf" or anything other than the correct numbers. Is this right? Thanks
...and what does that magical "e" mean? I compiled without that e and got like 7 errors. With it I got none.