This displays an animation of a bouncing ball. There are two Go buttons, and the animation runs when either button is clicked. The animation is sparked as a separate thread when "Go threaded" is clicked. The animation is run in the same thread when "Go not threaded" is clicked. The window also has a speed control scrollbar. When the threaded animation is running, the speed can be altered as the animation is running. Multiple bouncing balls can also be created, run by separate threads, when "Go threaded" is clicked. However, if the non-threaded animation is running, no further animation can be started, nor the speed altered, until the animation (ie the complete bounce) has finished - as the event loop is blocked. This illustrates the difference between threading and not threading event handlers.
SBJ March 1999