Java applet to practice the management of collisions