SAE21_2021/EtatPartie.java

20 lines
469 B
Java
Raw Normal View History

2022-05-04 23:23:27 +02:00
import javax.swing.*;
import java.awt.*;
public class EtatPartie extends JPanel {
// Définition du constructeur
2022-05-05 22:29:04 +02:00
public EtatPartie(int mines) {
2022-05-04 23:23:27 +02:00
super();
2022-05-05 23:13:52 +02:00
// On défini un style à la bannière
2022-05-17 11:11:29 +02:00
this.setBackground( new Color(0, 236, 96));
}
2022-05-05 22:29:04 +02:00
// Méthode pour afficher le nombre de mines restantes
2022-05-10 11:52:26 +02:00
public void setMinesLeft(int minesLeft){
2022-05-05 23:13:52 +02:00
this.removeAll();
2022-05-05 22:29:04 +02:00
this.add(new MineLeft(minesLeft,this.getSize()));
this.repaint();
this.updateUI();
}
2022-05-04 23:23:27 +02:00
}