Hi guys, at some point in my code I want to wait for one of two buttons to be pressed on a jpanel. Is there a better way to do this other than having the buttons set a boolean to true and then using a while loop in my code (to continuously check the value of the boolean)? This seems like a really messy solution, if it even works.
Whats the "real" way? Thanks.

