Pausing a loop until a button is pressed
For my code the most convenient method is to use a for loop. This works well, but at the end of each iteration I want the user to choose between on button, one that continues the loop and another that ends it. I can do this using break/changing variable, but I don't see how I can make my loop wait for the user to press the button after each time. Is there some code that I should put at the end of my loop?
Re: Pausing a loop until a button is pressed
Turn your for loop code into a class and use it as an ActionListener for the button. Every time the button gets pressed run one iteration. Variables which you want to keep persistent between iterations will need to be class fields.