I wrote a program that allows the user to enter the Identity Number, Name, Nationality, Job type of the client (ordinary, academician, medical person), Destination country, amount to be transferred in SAR, type of currency to be received (SAR, local currency)and then displays the Identity Number, Name, Nationality, Destination country, Amount to be transferred in SAR, Amount to be received, total amount to be paid by the client I need to know how do I do this : After each program run, I need to ask the user if she wants to continue using the program (using confirmation dialog of JOptionPane). If the user clicks YES, the program will continue and ask the user for another input. This process continues until the user clicks NO ... Please help!
Generally in cases like this I believe you need to loop round until the user selects a no option:
public class SO{
public static void main(String[] args) {
int choice = 0;
do{
choice = JOptionPane.showConfirmDialog(null, "Continue?");
} while(choice == JOptionPane.YES_OPTION);
}
}