import javax.swing.JOptionPane;
public class study2 {
public static void main(String[] args) {
String temp1 = null , temp2 = null;
int num1 = 0 , num2 = 0, max = 0;
int ret = 0;
inner: do {
try {
temp1 = JOptionPane.showInputDialog("The First Number is:");
num1 = Integer.parseInt(temp1);
temp2 = JOptionPane.showInputDialog("The Second Number is:");
num2 = Integer.parseInt(temp2);
}
catch(NumberFormatException ex) {
JOptionPane.showMessageDialog(null, "Invalid input");
continue inner;
}
if (num1 > num2)
max = num1;
else
max = num2;
JOptionPane.showMessageDialog(null,"The Maximum is " +max);
ret = JOptionPane.showConfirmDialog(null, "Continue?", "More",
JOptionPane.YES_NO_OPTION , JOptionPane.INFORMATION_MESSAGE);
} while(ret == JOptionPane.YES_OPTION);
}
}