make a Boolean parameter
like this:
Bollean flag =false;
and change your code like this:
while (again == JOptionPane.YES_OPTION){
JOptionPane.showInputDialog(null, /*need help here*/);
flag=true;
}
while (again == JOptionPane.NO_OPTION){
JOptionPane.showMessageDialog(null, "Closing...");
flag=false;
System.exit(0);
}
so after that do this:
while(flag){
String xString =
/*.
.
.
*/
System.exit(0);
}
}
}