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
| Niveau2(){
attend = true;
finie = false;
JPanel haut = new JPanel();
JPanel milieu = new JPanel();
JPanel bas = new JPanel();
b1=new JButton("Depart");
b2=new JButton("Pause");
b3=new JButton("Reprise");
b4=new JButton("Quitter");
monLaby1= new ZoneJeux();
monLaby2= new ZoneJeux();
milieu.setLayout(new GridLayout(1,2));
haut.add(b1);
haut.add(b2);
haut.add(b3);
haut.add(b4);
milieu.add(monLaby1);
milieu.add(monLaby2);
haut.setBackground(Color.gray);
milieu.setBackground(Color.white);
bas.setBackground(Color.gray);
Container c=this.getContentPane();
c.add("North",haut);
c.add("Center",milieu);
c.add("South",bas);
b1.addActionListener(new ActionB1());
b2.addActionListener(new ActionB2());
b3.addActionListener(new ActionB3());
b4.addActionListener(new ActionB4());
addKeyListener(this);
addMouseListener(this);
addMouseMotionListener(this);
pack();
setVisible(true);
monLaby1.addSouris(Color.RED);
monLaby2.addSouris(Color.BLUE);
requestFocus();
} |
Partager