if (event.getSource() == stringField)
{
try
{
int number = Integer.parseInt(stringField.getText());
checkNum(number);
resultField.setText("Squared value is " + number*number);
}
catch (NumberFormatException e)
{
resultField.setText("Error in number : Retype");
}
catch (myException me)
{
resultField.setText("negative number: retype ");
}
}// endif