retour direct au menu

This commit is contained in:
Haïssous Kayyissa 2022-05-21 23:01:08 +02:00
parent 53f23d7cf3
commit d0d1aa9cf8
4 changed files with 9 additions and 10 deletions

Binary file not shown.

View File

@ -1,6 +1,5 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Banniere extends JPanel {
private FrameJeu fenetre;
@ -26,17 +25,17 @@ public class Banniere extends JPanel {
public void setVictoire(){
this.add(new Fin("Victoire !",this.getSize()));
this.repaint();
JButton menu = new JButton("Revenir au menu");
menu.addActionListener(new MenuListener(this.fenetre));
this.add(menu);
// TODO : délai
new FrameMenu();
this.fenetre.dispose();
}
// Méthode pour indiquer au joueur sa Défaite
public void setDefaite(){
this.add(new Fin("Défaite !",this.getSize()));
this.repaint();
JButton menu = new JButton("Revenir au menu");
menu.addActionListener(new MenuListener(this.fenetre));
this.add(menu);
// TODO : délai
new FrameMenu();
this.fenetre.dispose();
}
}

View File

@ -26,9 +26,9 @@ public class FrameMenu extends JFrame{
// On créer les zones de textes de saisie
this.sliderLignes = new JSlider(4,30);
this.sliderColonnes = new JSlider(4,30);
this.sliderMines = new JSlider(1,900, 16);
this.sliderLignes = new JSlider(4,30,20);
this.sliderColonnes = new JSlider(4,30,25);
this.sliderMines = new JSlider(1,900, 50);
sliderLignes.addChangeListener(new SettingsListener(0,this));
sliderColonnes.addChangeListener(new SettingsListener(1,this));

BIN
Rapport.odt Normal file

Binary file not shown.