Установите JLabel Visible при нажатии JButton в actionPerformed

Я пытаюсь заставить JLabel появляться при нажатии JButton. Я добавил слушатель действия и добавил компонент в макет. Я использую label1.setVisible (true), когда JButton нажимается в actionPerformed. Я до сих пор не могу заставить его работать. Кто-нибудь может посмотреть на мой код?

public class LearnAppMain extends JFrame implements ActionListener {

// Define variables
public JButton button1;
public JLabel label1;
    public JTextField field1;

    private Image image1;
private String apple = "apple.jpg";

public LearnAppMain() {

    ImageIcon image1 = new ImageIcon(this.getClass().getResource(apple));
    JLabel label1 = new JLabel(image1);

    button1 = new JButton("A");
    button1.addActionListener(this);

    field1 = new JTextField(10);

    // Create layout
    setLayout(new FlowLayout());

    // create Container
    final Container cn = getContentPane();

    cn.add(button1);
    cn.add(field1);
    cn.add(label1);

    // setLayout(new FlowLayout());
    setSize(250, 250);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
}

@Override
public void actionPerformed(ActionEvent e) {

    Object source = e.getSource();

    if (e.getSource() == button1) {
        label1.setVisible(true);
        field1.setText("Apple");
    }

}

 }

У меня есть основной метод в другом файле класса. Ошибка, которую я получаю, приводит меня к label1.setVisible (true);

Каждый вопрос, который я видел, говорят, чтобы сделать это, но мне интересно, есть ли что-то еще, что нужно добавить.