title: Removing JPanel from a JFrame in NetBeans
body: <p>I have several JPanels that contain buttons, labels, etc. that I want to switch between from a main JFrame. Currently I am trying to use the  <code>this.add(JPanelname);</code> method and <code>this.remove(JPanelname);</code> with the <code>validate();</code> and <code>repaint();</code> methods</p>
  
  <p>The problem is it will add the panel to the <code>JFrame</code> but it will not remove it. I am not sure how exactly to go about this.</p>