Créer l’image d’un composant à l’aide de ‘Component.createImage()’

Author:

 set, swing, awt, JFrame
{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();
    frame.setVisible(true);
    int width = 300;
    int height = 500;
    // Créer une image du composant JFrame
    BufferedImage bimage = (BufferedImage) frame.createImage(width, height);

  }
}



Leave a Reply

Your email address will not be published. Required fields are marked *