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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.