How do I capture a screendump of a Swing-based GUI?
Created May 4, 2012
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);