import javax.swing.*; import java.awt.*; public class FenetreJeu extends JFrame { private Grille grille; public FenetreJeu(Grille g) { super("Démineur - Partie en cours"); this.grille = g; this.setSize(600, 600); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLayout(new BorderLayout()); JPanel panneauGrille = new JPanel(); panneauGrille.setLayout(new GridLayout(g.getLignes(), g.getColonnes())); for (int i = 0; i < g.getLignes(); i++) { for (int j = 0; j < g.getColonnes(); j++) { JButton boutonCase = new JButton("?"); panneauGrille.add(boutonCase); } } this.add(panneauGrille, BorderLayout.CENTER); JButton btnSauverQuitter = new JButton("Sauver et Quitter"); this.add(btnSauverQuitter, BorderLayout.SOUTH); ControleurJeu controleur = new ControleurJeu(this); btnSauverQuitter.addActionListener(controleur); } }