An easy way of implementing double buffering for a JFrame is to use BufferStrategy (from awt.image)
After you construct the JFrame (and have made it visible) you can use:
Code:
myframe.createBufferStrategy(2);
When it comes time to draw stuff to the JFrame, you will need to reference the JFrame's BufferStrategy:
Code:
BufferStrategy mybufferstrategy = this.getBufferStrategy();
and then assign a graphics component to it:
Code:
Graphics g = mybufferstrategy.getDrawGraphics();
Finally, draw whatever you want to the graphics component and then display the contents of the buffer on the JFrame with:
Code:
mybufferstrategy.show();
Hope this helps.