Improved Double Buffering
Another method of handling double buffering is to override invalidate():
public void invalidate() {
super.invalidate();
offscreen = null;
}
/* The offscreen variable refers to the image, not the graphics context */
Previous slide
Next slide
Back to first slide
View graphic version