I am using JAVA to simulate a water heater. For a switch I am using buttons, ON, OFF and EXIT. EXIT exits the program, OFF switches the heater off and On switches starts the heating and cooling process.
Basically, I want the heating and cooling process to be an infinite loop until another button is pressed. The problem right now is that when i start the cooling and heating process, the program does not accept any other buttons i press.
How can i break the loop once another button is pressed, no matter where the program is within the loop?
2007-11-03
21:23:15
·
3 answers
·
asked by
airam
2