Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listening for events during loop

Status
Not open for further replies.

dwentink

Programmer
Apr 5, 2002
11
NL
Hi,
I have made an applet that draws a moving 'ball' onto the screen. It does this in a loop in the paint() method of the applet. Now I want to stop the loop when a button is pressed. The program however does not notice when I press the button because it is in the loop.
Does someone know if there is some method to 'listen' for events during a loop?
Thanx
Diederik
 
you probably don't want a loop in the paint method. instead you want a loop to be calling the paint method. that way you can throw in the listener in the loop with the paint method. --Derek

"Fear not the storm for this is where we grow strong."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top