christian speed dating in boston - Java 2d graphics paint flicker when updating

Java 2d graphics paint flicker when updating

Now that we’ve learned about the basic tools, let’s put a few of them together.

In this section, we’ll look at some techniques for doing fast and flicker-free drawing and painting.

This doesn’t save the time our application spends calling the drawing methods, but the overhead of calling these kinds of drawing methods is usually negligible compared to the time it takes to execute them.

(If we were generating an image pixel by pixel, this would not be the case, as the calculations would be the major time sink, not the drawing.)So we can save some time in our application by redrawing only the affected portion of the display.

Fortunately, Swing now handles double buffering by default.