Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Create an image of swing component using Component.createImage()

Java: Create an image of swing component using Component.createImage()
{filelink=10262}

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

Users who found this page were searching for:

  • java output image using swing

No comments yet.

Leave a Comment