Java examples for Swing:JComponent
screen Shot JComponent
//package com.java2s; import java.awt.image.BufferedImage; import javax.swing.JComponent; public class Main { public static BufferedImage screenShot(JComponent c, int w, int h) { BufferedImage b = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); c.paint(b.createGraphics());/*w w w .j a v a 2 s . c om*/ return b; } }