

import java.awt.*;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;


public class JPanelImage extends JPanel {
	private static final long serialVersionUID = -4704888296894874299L;

	private BufferedImage image=null;

	public JPanelImage() {
		
	}
	
	/**
	 * redéfinition de la methode de dessin du JPanel
	 * @param g
	 */
	public void paintComponent(Graphics g) {
		super.paintComponent(g);

		this.setBackground(Color.white);
		if(image!=null) {
			g.drawImage(image, 0, 0, this.getWidth(),this.getHeight(),this);
		}

	}

	public BufferedImage getImage() {
		return image;
	}

	public void setImage(BufferedImage buff) {
		image=buff;
	}

}
