title: Why is the program throwing an error "cannot find symbol" at setVisible in my showPanel method?
body: <p>Why is the <code>setVisible</code> method throwing an error saying symbol not found in my <code>showPanel</code> method?
  It does not make sense as I am referencing a <code>JPanel</code> stored in an <code>ArrayList</code> so it should be able to use <code>setVisible</code>.</p>
  
  <pre><code>public class mainFrame extends javax.swing.JFrame {
  
  /**
   * Creates new form mainFrame
   */
  private ArrayList list;
  public mainFrame() {
      initComponents();
  this.setSize(500,500);
      int h=this.getHeight();
      int w=this.getWidth();
  
      homePanel homePnl = new homePanel();
      this.add(homePnl);
      homePnl.setLocation(0,0);
      homePnl.setSize(w,h);
      homePnl.setVisible(true);
  
      DeploymentInfoPanel infoPanel = new DeploymentInfoPanel();
      this.add(infoPanel);
      infoPanel.setLocation(0,0);
      infoPanel.setSize(w,h);
  
      atomServerPanel atomPnl = new atomServerPanel();
      this.add(atomPnl);
      atomPnl.setLocation(0,0);
      atomPnl.setSize(w,h);
  
      autoDeploymentPanel autoPnl = new autoDeploymentPanel();
      this.add(autoPnl);
      autoPnl.setLocation(0,0);
      autoPnl.setSize(w,h);
  
      list = new ArrayList&lt;&gt;();
      list.add(homePnl);
      list.add(infoPanel);
      list.add(atomPnl);
      list.add(autoPnl);
  
  
      this.pack();
  }
  
  public void showPanel(int panelNum){
      list.get(1).setVisible(true);
  }
  </code></pre>