title: How to hide tabbed panel in JTabbedPane?
body: <p>I have:</p>
  
  <pre><code>JTabbedPane jtabbedPane = new JTabbedPane();
  jTabbedPane.addTab("Tab 1", panel1);
  jTabbedPane.addTab("Tab 2", panel2);
  jTabbedPane.addTab("Tab 3", panel3);
  </code></pre>
  
  <p>What I want to do is hide Tab 2 when a condition occurs (say the user isn't permitted to access that tabbed panel. </p>
  
  <p>Yes I know you can do:</p>
  
  <pre><code>jtabbedPane.setEnabled(1, false); // disable Tab 2
  </code></pre>
  
  <p>which will gray it out, <strong><em>but I want to completely hide it so that the user doesn't even know it's even a possibility in the software</em></strong>. They shouldn't be even aware that it exists.</p>
  
  <p>I do NOT want to do</p>
  
  <pre><code>jtabbedPane.remove(1); // remove Tab 2
  </code></pre>
  
  <p>because I then have to remove/add on a regular basis.</p>