[SOLVED] (Double.toString(age)) & if ((age.isEmpty())) {
Can someone just take a look at this code and tell me what is wrong
Code:
txtAge.setText(Double.toString(age));
if ((age.isEmpty())) {
// if no entry is made then throw error
throw new IllegalArgumentException("You did not enter any age");
}
catch (IllegalArgumentException e) { // catch the error
optPane1.showMessageDialog(this,e.getMessage(),"please enter your age",optPane1.ERROR_MESSAGE);
}
I dont know whether its just the opening and closing braces or I have written it wrong.
Thanks in advance