import javax.swing.JOptionPane;
public class trycatch
{
public static void main(String args[])
{
boolean loop=false;
do
{
try
{
String strinput=JOptionPane.showInputDialog(null,"Enter a integer");
int input=Integer.parseInt(strinput);
}
catch(NumberFormatException ex)
{
OptionPane.showMessageDialog(null,"Invalid value entered");
loop=true;
}
}while(loop);
}
}
can some one help me solve this , the problem is once the exception is catch then the CANCEL & CLOSED OPTION cant close the JOptionPane,thanks