O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How Double Buffering Works

If the next frame of an animation is updated onscreen, you have single buffering—all the painting is done in a single buffer—not to mention potential flicker between frames. If the next frame is updated in an offscreen buffer and subsequently copied to the screen, you have double buffering and no flicker because the erasing takes place offscreen.

Flicker is a symptom of erasing part or all of the previous frame onscreen when rendering the next frame in an animation; the erasing can be impossible to avoid with animations of any complexity. Double buffering eliminates the flicker by preparing the next frame in an offscreen buffer, and then copying—or blitting—the completed frame to the screen, avoiding the onscreen erasing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required