The basic idea behind double buffering is this: You declare a variable which you will use either to load an external image into or to draw on. In either case, the operations are done "off screen". You then start a separate thread in which to display the image on the screen when the data in the off-screen variable are complete. Normally, you repeat the process in a loop, either loading images or drawing on the image. The important point is that you create the image piecemeal but then display it all at once, as fast as your system can transfer data from the image buffer to the screen.The relevant classes are contained in the
java.awtandjava.appletpackages. In particular, look at thejava.awt.Imageandjava.awt.Graphicsclasses. You may also wish to review theThreadclass and theRunnableinterface.