title: Why won't my buttons appear when I run this JFrame?
body: <p>I am trying to make a Rock, Paper, Scissors game and I have added 3 buttons to the frame, however when I launch the program two of the buttons don't appear until you hover over them, anyone have any idea why?</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.event.*;
  import java.util.Random;
  import java.awt.FlowLayout;
  import javax.swing.JOptionPane;
  public class RPSFrame extends JFrame {
  public static void main(String [] args){
      new RPSFrame();
  }
  public RPSFrame(){
      JFrame Frame1 = new JFrame();
      this.setSize(500,500);
      this.setVisible(true);
      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      this.setTitle("Rock, Paper or Scissors game");
      this.setLocationRelativeTo(null);
      ClickListener cl1 = new ClickListener();
      ClickListener cl2 = new ClickListener();
      ClickListener cl3 = new ClickListener();
  
      JPanel panel1 = new JPanel();
      JLabel label1 = new JLabel("Result:");
      panel1.setLayout(new FlowLayout(FlowLayout.CENTER, 25, 25));
      this.add(panel1);
      this.setVisible(false);
  
      JPanel panel2 = new JPanel();
      JButton Rock = new JButton("Rock");
      Rock.addActionListener(cl1);
      panel2.setLayout(new FlowLayout(FlowLayout.LEFT));
      panel2.add(Rock);
      this.add(panel2);
      this.setVisible(true);
      JPanel panel3 = new JPanel();
      JButton Paper = new JButton("Paper");
      Paper.addActionListener(cl2);
      panel3.setLayout(new FlowLayout(FlowLayout.CENTER));
      panel3.add(Paper);
      this.add(panel3);
      this.setVisible(true);
      JPanel panel4 = new JPanel();
      JButton Scissors = new JButton("Scissors");
      Scissors.addActionListener(cl3);
      panel4.setLayout(new FlowLayout(FlowLayout.RIGHT));
      panel4.add(Scissors);
      this.add(panel4);
      this.setVisible(true);
  }
  private class ClickListener implements ActionListener{
  
      public void actionPerformed(ActionEvent e){
          if(e.getSource() == "Rock"){
              int AI = new Random().nextInt(3) + 1;
              JOptionPane.showMessageDialog(null, "I have been clicked!");
          }
      }
  }
  </code></pre>
  
  <p>}</p>