title: ActionListener() on JButton not working (even though I coded other buttons the same way)
body: <p>I know similar questions have been asked but everyone's code is different and the solutions to their mistakes aren't really helping me to find a solution.</p>
  
  <pre><code>//Libraries
  import java.awt.Color;
  import java.awt.Font;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.*;
  
  
  public class SliderGame implements ActionListener  {
      JLabel referenceLabel1;
      JLabel instruc1;
      JLabel preGame1;
      JButton gotIt1;
      JButton addPicture1;
      JPanel instructionsPanel1;
      JPanel gameboardFoundation1;
  
      public SliderGame(){
  
       //Image that shows user what their objective is
       referenceLabel1 = new JLabel(new ImageIcon("Images/SliderEasy.jpg"));
       referenceLabel1.setBounds(100,150,300,300);
       referenceLabel1.setVisible(true);
       easyBackground.add(referenceLabel1);
  
       //"your objective" pregame = before the game starts
       preGame1 = new JLabel("Your objective:");
       preGame1.setBounds(500,150,300,100);
       preGame1.setFont(new Font ("Courier New", Font.ITALIC, 28));
       preGame1.setVisible(true);
       easyBackground.add(preGame1);
  
       //Tells you the instructions
       instruc1 = new JLabel ("&lt;html&gt;Use the mouse &amp; click to move piece into 
       the blank spot to get the numbers in order, as shown on the left -- As 
       fast as you can!&lt;html&gt;");
       instruc1.setBounds(500, 190, 300, 200);
       instruc1.setFont(new Font ("Courier New", Font.PLAIN, 20));
       instruc1.setVisible(true);
       easyBackground.add(instruc1);
  
       //Press to play
       gotIt1 = new JButton ("Got it!");
       gotIt1.setBounds(500, 375, 100, 50);
       gotIt1.setFont(new Font ("Courier New", Font.PLAIN, 12));
       gotIt1.setVisible(true);
       easyBackground.add(gotIt1);
       gotIt1.addActionListener(this);
  
       //Press to choose images from a library
       addPicture1 = new JButton ("Use Picture");
       addPicture1.setBounds(615, 375, 135, 50);
       addPicture1.setFont(new Font ("Courier New", Font.PLAIN, 12));
       addPicture1.setVisible(true);
       easyBackground.add(addPicture1);   
       addPicture1.addActionListener(this); 
  
       //Panel that holds the gameboard
       gameboardFoundation1 = new JPanel();
       gameboardFoundation1.setLayout(new GridLayout(3,3,3,3));
       gameboardFoundation1.setBounds(100, 150, 300, 300);
       gameboardFoundation1.setOpaque(false);
       gameboardFoundation1.setVisible(false);
       easyBackground.add(gameboardFoundation1);
  }
  
      public void actionPerformed (ActionEvent e) {
  
          if(e.getSource().equals(gotIt1)) {
  
          preGame1.setVisible(false);
          instruc1.setVisible(false);
          gotIt1.setVisible(false);
          addPicture1.setVisible(false);
          referenceLabel1.setVisible(false);
  
          gameboardFoundation1.setVisible(true);
  
      }
  } 
  </code></pre>
  
  <p>I didn't include all of my code, so instances where it says mainFrame.add() for example, mainFrame exists, just I didn't add it to the question. The code works up until the point I click on the JButton gotIt1 and nothing changes. This is weird because I formatted all of the other buttons I used throughout my program and they work just fine.   </p>
  
  <p>I'm a beginner coder, especially at GUIs. I know my code isn't probably the cleanest but that's besides the point. Why isn't my button working!?</p>
  
  <p>Thanks in advance.</p>