Swing takes care of the details. Notice that a JPanel Swing component replaces the AWT Panel in BouncingCircle.java. This JPanel component implements double buffering and gets rid of the flickering problem. This applet contains circles bouncing around on the screen. Does not use double buffering so has problems with overlapping circles.
Overrides update to avoid flicker problems.
Just like in the previous example this applet contains circles bouncing around on the screen. However, this time double buffering is used for speed and to avoid problems with overlapping circles. All circles are drawn onto an offscreen image and then copied to the display area. BouncingCircles.java, SimpleCircle.java and MovingCircle.java remain the same as in the previous example.