Mechanics of Double-Buffering
Now, we draw as usual, except that we use the “osG” reference, not the more familiar “g” reference to the Graphics object.
When we are done, the LAST line of our paint (before repaint(), that is), should blit the off-screen image to screen:
g.drawImage (osImg,0,0,this);