You have created 3 local variables within the gui()
constructor
JButton b1 = new JButton(d);
JButton b2 = new JButton(f);
JButton b3 = new JButton(g);
I think you wanted to initialize the fields?
b1 = new JButton(d);
b2 = new JButton(f);
b3 = new JButton(g);
since you are comparing source
with the fields b1
, b2
.. in actionPerformed(ActionEvent e) {