How do I capture a screendump of a Swing-based GUI?

John Zukowski

As long as you don't need the window manager adornments, you can use the RepaintManager to capture the image on any Swing component:

RepaintManager manager = RepaintManager.currentManager(component);
Image htmlImage = manager.getOffscreenBuffer(component, compWidth, compHeight); 
About | Sitemap | Contact