Bouncing Ballsmain applet index page
Each ball is animated in a separate thread; access to the applet's canvas for updating the position of each ball is synchronized on the "box" object that contains the canvas and the collection of ball objects.
I know that it's better to use double buffering when doing an animation in order to eliminate flashing, but double buffering isn't used by this applet. The point of the exercise here is to see how far I could get without having some central loop in the box object that refreshes all the bouncers in "lock step". Instead, each bouncer redraws itself at its own rate; there's no central loop. Except for a small amount of residual flashing, this seems to come off pretty well.
Back to my Applets page.