ReponseAuClic.java
516 Bytes
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));
}
}