Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Accessing Swing widgets while double buffering



I'm double buffering to reduce screen flicker which basically means that instead of calling repaint(), I'm drawing directly to an Image object and then call JPanel.getGraphics().drawImage(myMasterImage) to refresh the display. I would like to make use of some Swing's GUI widgets, like JCheckBox. Is there a way I can extract a widget's display as an Image so I can just throw it into my master image using it's Graphics.drawImage() method?