-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFenetreMenu.java
67 lines (53 loc) · 1.98 KB
/
FenetreMenu.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import javax.swing.*;
import java.awt.*;
import java.awt.Color;
import java.awt.event.*;
import java.util.*;
public class FenetreMenu extends JFrame implements ActionListener {
private JButton jButton1;//Jouer
private JButton jButton2;//Quitter
private JLabel jLabel1;
private LinkedList<Carte> pioche;
private Joueur [] joueurs;
public FenetreMenu(LinkedList<Carte> p, Joueur [] j) {
super("Menu");
this.setSize(1920,1080);
this.setLocation(0,0);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
joueurs=j;
pioche=p;
jButton1 = new JButton();
jLabel1 = new JLabel();
jButton2 = new JButton();
jButton1.setFont(new java.awt.Font("Segoe UI", 1, 70));
jButton1.setText("Jouer");
jButton1.setBounds(760,412,350,250);
jButton1.addActionListener(this);
jButton2.setFont(new java.awt.Font("Segoe UI", 1, 70));
jButton2.setText("Quitter");
jButton2.setBounds(760,742,350,250);
jButton2.addActionListener(this);
JLabel photo=new JLabel(new ImageIcon("unobackground1.png"));
photo.setBounds(0,0,1920,1080);
//JPanel principal
JPanel conteneurPrincipal = new JPanel();
conteneurPrincipal.setLayout(null);
conteneurPrincipal.setBounds(0,0,1920,1080);
conteneurPrincipal.add(jButton2);
conteneurPrincipal.add(jButton1);
conteneurPrincipal.add(photo);
this.add(conteneurPrincipal);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
NomJoueurs fenetrejoueurs=new NomJoueurs(pioche);
fenetrejoueurs.joueurs=joueurs;
if(e.getSource()==jButton1){
fenetrejoueurs.setVisible(true);
}
if(e.getSource()==jButton2){
setVisible(false);
}
}
}