I started with a simple applet, just so I could excercise with threads, but I got carried away. Now the applet has nice features like kinetic energy coloring and resizing. The screen contains a number of balls that collide without loss of energy and without any external force acting upon them. The balls are subject to the laws of conservation of kinetic energy and impulse.
All balls have equal specific gravity.
At startup the applet fills the screen randomly with 10 balls that start running immediately. All controls except the Stop -button are deisabled. You may interrupt the applet by clicking the Stop -button. The other controls are now available. If you click the Start- button, the balls begin to roll again, unless you have made a change to one of the parameters of the applet.