import javax.swing.JFrame;
import java.awt.image.BufferedImage;
public class ComponentImage
{
public static void main(String[] argv) throws Exception
{
JFrame frame = new JFrame();
frame.setVisible(true);
int width = 300;
int height = 500;
// Créer une image du composant JFrame
BufferedImage bimage = (BufferedImage) frame.createImage(width, height);
}
}