SAE21_2021/Etoile.java

17 lines
473 B
Java
Raw Normal View History

2022-04-26 10:42:13 +02:00
import javax.swing.JComponent;
import java.awt.*;
2022-04-27 16:16:34 +02:00
// Création d'un Jcomponent Etoile, qui sert pour le marquage des mines
2022-04-26 10:42:13 +02:00
public class Etoile extends JComponent {
2022-04-27 16:16:34 +02:00
private Image etoileImage;
public Etoile() {
super();
this.etoileImage = Toolkit.getDefaultToolkit().getImage("etoile.png");
}
2022-04-26 10:42:13 +02:00
@Override
protected void paintComponent(Graphics pinceau) {
Graphics etoile = pinceau.create();
2022-04-27 16:16:34 +02:00
etoile.drawImage(this.etoileImage,5,10,90,80,this);
2022-04-26 10:42:13 +02:00
}
}