title: Is there a way to hide the tab bar of JTabbedPane if only one tab exists?
body: <p>I want a behavior similar to e.g. Firefox where the list of available tabs does only show up if at least two tabs exist.</p>
  
  <p>I wasn't able to find anything like that, yet.</p>
  
  <p>The best idea I had was changing the layout manually:</p>
  
  <ul>
  <li>in case of one component, just add that to the surrounding panel</li>
  <li>if a component is added, remove the component from the surrounding panel, add a JTabbedPane instead and add both the previous and the new component to that pane.</li>
  <li>if a component is removed and only one component is left in the pane, remove the pane and add the contained component instead.</li>
  </ul>
  
  <p>While this would probably work it feels like a hack or workaround...</p>
  
  <p>Any better idea?</p>
  
  <p>A solution should ideally work in both Java 1.5 and 1.6... but I'd be happy about a 1.6-only solution, too.</p>