|
|
|
@ -7,6 +7,9 @@ import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Color;
|
|
|
|
|
|
|
|
|
|
import gui.Boutton;
|
|
|
|
|
import modeles.Labyrinthe;
|
|
|
|
|
import modeles.Menu;
|
|
|
|
|
import modeles.Objet;
|
|
|
|
|
import gui.Background;
|
|
|
|
|
import java.awt.Dimension;
|
|
|
|
|
import java.awt.FlowLayout;
|
|
|
|
@ -14,6 +17,8 @@ import java.awt.GraphicsConfiguration;
|
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
|
import java.awt.HeadlessException;
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
@ -32,9 +37,9 @@ import org.eclipse.swt.SWT;
|
|
|
|
|
* @author nicolas
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public class jeu extends JFrame {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class jeu extends JFrame implements ActionListener {
|
|
|
|
|
JButton continuer =new JButton("Continuer");
|
|
|
|
|
JButton nouvelle = new JButton("Nouvelle Partie");
|
|
|
|
|
public jeu() throws IOException {
|
|
|
|
|
super();
|
|
|
|
|
build();
|
|
|
|
@ -52,23 +57,24 @@ public class jeu extends JFrame {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
container.setLayout(new GridBagLayout());
|
|
|
|
|
JButton test2 = new JButton("Nouvelle Partie");
|
|
|
|
|
JButton test =new JButton("Continuer");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nouvelle.addActionListener(this);
|
|
|
|
|
continuer.addActionListener(this);
|
|
|
|
|
GridBagConstraints c = new GridBagConstraints();
|
|
|
|
|
c.gridx = 0;
|
|
|
|
|
c.gridy = 0;
|
|
|
|
|
container.add(test);
|
|
|
|
|
container.add(nouvelle);
|
|
|
|
|
|
|
|
|
|
c.gridx = 1;
|
|
|
|
|
c.gridy=0;
|
|
|
|
|
container.add(test2);
|
|
|
|
|
container.add(continuer);
|
|
|
|
|
|
|
|
|
|
this.setContentPane(container);
|
|
|
|
|
this.setVisible(true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public JPanel buildContentPane() {
|
|
|
|
|
public void buildContentPane() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -76,6 +82,22 @@ public class jeu extends JFrame {
|
|
|
|
|
BufferedImage image = ImageIO.read(new File("/home/nicolas/eclipse-workspace/Projet_Java/JAVA/PROJET-PMT_STRI1A/test.jpg"));
|
|
|
|
|
return image;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent arg0) {
|
|
|
|
|
Object source=arg0.getSource();
|
|
|
|
|
if(source==nouvelle) {
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
Labyrinthe lab=menu.nouvellePartie();
|
|
|
|
|
}
|
|
|
|
|
if(source==continuer) {
|
|
|
|
|
Menu menu = new Menu();
|
|
|
|
|
Labyrinthe lab = menu.continuer();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|