[Aos] Missing code in lab manual
Matthew Holmes
Matthew.Holmes at students.wits.ac.za
Sat Jul 27 20:38:26 SAST 2013
Hi all,
On page 18 of the lab manual under Step 6 there is code missing. Here is what Mike sent me:
if(eve.target == inputField)
{
try
{
int age = Integer.parseInt(inputField.getText());
inputField.setText("");
if(age < PENSIONABLE_AGE)
{
throw new Exception("Exception: At age " + age + ", you do not yet qualify
for a state pension");
}
else
{
outputField.setText("At age " + age + ", you qualify for a state
pension");
}
}
catch(Exception e)
{
outputField.setText(e.getMessage());
}
}
It's been tested and works fine.
Cheers,
Matthew.
More information about the Aos
mailing list