Here's the simplest thing I can think of: put the confirmDialog inside your first while statement. Then, if the user clicks "No", you can tell the program to just ccontinue to the next while...