BUT2/DEV/DEV2.1/test/test_image_grille/testImage.java

16 lines
445 B
Java
Raw Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.JComponent;
import java.awt.*;
public class testImage extends JComponent {
Image image;
public testImage(String cheminImage){
this.image = Toolkit.getDefaultToolkit().getImage(cheminImage);
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
secondPinceau.drawImage(this.image,0, 0, this.getWidth(), this.getHeight(), this);
}
}