bonsoir tout le monde je me bloque dans la gestion des evenements dans une application de calculatrice voila mon code
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class calculatrice extends JFrame implements ActionListener{
public calculatrice(){
super();
setSize(300,400);
setLayout(new FlowLayout());
setLayout(new GridLayout(4,3,5,5));
Button b10=new Button("0");
add(b10);
b10.addActionListener(this);
Button b1=new Button("1");
add(b1);
b1.addActionListener(this);
Button b2= new Button("2");
add(b2);
Button b3=new Button("3");
add(b3);
b3.addActionListener(this);
Button b4=new Button("4");
add(b4);
b4.addActionListener(this);
Button b5=new Button("5");
add(b5);
b5.addActionListener(this);
Button b6=new Button("6");
add(b6);
b6.addActionListener(this);
Button b7=new Button("7");
add(b7);
b7.addActionListener(this);
Button b8=new Button("8");
add(b8);
b8.addActionListener(this);
Button b9=new Button("9");
add(b9);
b9.addActionListener(this);
Button b11=new Button("+");
add(b11);
b11.addActionListener(this);
Button b12=new Button("-");
add(b12);
b12.addActionListener(this);
Button b13=new Button("*");
add(b13);
b13.addActionListener(this);
Button b14=new Button("/");
add(b14);
b14.addActionListener(this);
JPanel f=new JPanel();
JPanel g=new JPanel();
add(g);
g.setSize(200,100);
g.setLayout(new FlowLayout());
TextField tf= new TextField();
g.add(tf);
show();
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()=="1");
}
}