public class MainFrame extends JFrame {
MainFrame()
{
JButton zeroButton = new JButton("0");
add(zeroButton);
Handler handler = new Handler();
zeroButton.addActionListener(handler);
}
private class Handler implements ActionListener
{
public void actionPerformed(ActionEvent e) {
if (e.getSource() == **zeroButton**)
JOptionPane.showMessageDialog(null, "hello there!");
}
}
}
The code has an error which underlines what I marked as bold in the code. here is the error message: "cannot find symbol"
I thought I can access outer class modifiers from the inner class, but it doesn't work!