Blame view

src/tp2/evenements/ReponseAuClic.java 516 Bytes
3c9d20ad   shaggy42089   nearly finished tp2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  package tp2.evenements;
  
  import javax.swing.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  public class ReponseAuClic implements ActionListener {
  
      private JLabel label;
  
      public ReponseAuClic(JLabel c) {
          label = c;
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
          //question 2
          //System.out.println("Clic sur le bouton");
  
          String old = label.getText();
          label.setText(Integer.toString(Integer.parseInt(old)+1));
      }
  }