I have a little Applet that needs to alert the user when they enter an invalid value (non-integer, or integer out of range). The pop-up occurs, but there is no way to get out of it short of killing the application (AppletViewer or IE). Here is the method that generates the popup(s). They are both acting incorrectly:
How do I close the dialog box and return control back to the Applet? I'm very much a novice at this, so don't take anything for granted regarding my background knowledge. Thanks in advance!
"Proof that there is intelligent life in Oregon. Well, Life anyway.
Code:
private class selectNumber implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
Frame child = new Frame();
boolean isGoodNumber = false;
Integer lineNumber = new Integer(0);
while (!isGoodNumber)
{
try
{
lineNumber = Integer.parseInt(number.getText());
isGoodNumber = true;
}
catch(NumberFormatException nfe)
{
JOptionPane.showMessageDialog(child,
"That wasn't an Entrant number!",
"Entrant Number Error",
JOptionPane.ERROR_MESSAGE);
}
if(isGoodNumber)
{
Entrant b = map.get(lineNumber);
if (b == null)
{
JOptionPane.showMessageDialog(child,
"Entrant number " + lineNumber.intValue() + " does not exist!",
"Entrant Number Error",
JOptionPane.ERROR_MESSAGE);
isGoodNumber = false;
}
else
getEntrant(b);
}
}
}
}
How do I close the dialog box and return control back to the Applet? I'm very much a novice at this, so don't take anything for granted regarding my background knowledge. Thanks in advance!
"Proof that there is intelligent life in Oregon. Well, Life anyway.