Blame view

src/tp2/evenements/MainClass.java 899 Bytes
3c9d20ad   shaggy42089   nearly finished tp2
1
  package tp2.evenements;
af80f4c2   Shaggy420   added src files
2
3
4
5
6
7
8
  
  
  import javax.swing.*;
  import java.awt.*;
  
  public class MainClass {
      public static void main(String[] args) {
af80f4c2   Shaggy420   added src files
9
          JLabel label = new JLabel("0");
3c9d20ad   shaggy42089   nearly finished tp2
10
11
12
13
          label.setFont(new Font("SansSerif", Font.PLAIN, 25));
  
          JPanel topPanel = new JPanel();
          topPanel.add(label);
af80f4c2   Shaggy420   added src files
14
  
af80f4c2   Shaggy420   added src files
15
16
  
          JButton incbutt = new JButton("incrémenter");
3c9d20ad   shaggy42089   nearly finished tp2
17
          incbutt.addActionListener(new ReponseAuClic(label));
af80f4c2   Shaggy420   added src files
18
  
3c9d20ad   shaggy42089   nearly finished tp2
19
20
          JPanel botPanel = new JPanel();
          botPanel.add(incbutt);
af80f4c2   Shaggy420   added src files
21
  
3c9d20ad   shaggy42089   nearly finished tp2
22
23
24
25
26
27
28
29
  
          JFrame win = new JFrame();
          win.setLocationRelativeTo(null);
          BoxLayout layout = new BoxLayout(win.getContentPane(), BoxLayout.Y_AXIS);
          win.setLayout(layout);
  
          win.add(topPanel);
          win.add(botPanel);
af80f4c2   Shaggy420   added src files
30
31
  
          win.setResizable(false);
3c9d20ad   shaggy42089   nearly finished tp2
32
33
34
          win.pack();
  
          win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
af80f4c2   Shaggy420   added src files
35
36
37
          win.setVisible(true);
      }
  }