An Introduction to Double Buffering

If you run the application listed in “Dissolver Test Application”, you will notice that the application flickers between frames. This flickering is due to the fact that the Dissolver class must clear the previous image every time it draws a partially dissolved image. Clearing the background of the component before drawing the next frame results in flickering, which can be that is eliminated by a technique known as double buffering.

In “Double Buffering”, we will examine double buffering in detail by discussing a set of classes that can be used for dragging and animating lightweight components. This section will serve as a foundation for that chapter.

Double buffering is a simple concept. Instead of drawing ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.