title: Java JTabbedPane and stateChanged event, getTabCount() with bug?
body: <p>I'm not a java developer, but I'm trying to use Netbeans 8.0.1 and java 1.8.0_05 for a wizard application.
  I added a JTabbedPane (with 5 tabs) in my project and associated a stateChanged event to enable or disable two button: "next" and "prev".</p>
  
  <pre><code>private void tabbedPaneStateChanged(javax.swing.event.ChangeEvent evt)                                        
  {                                            
      bttPrev.setEnabled(tabbedPane.getSelectedIndex() &gt; 0);
      bttNext.setEnabled(tabbedPane.getSelectedIndex() &lt; (tabbedPane.getTabCount() - 1));
  }
  </code></pre>
  
  <p>When I run the application both button are disabled. In debug I have noticed:</p>
  
  <pre><code>tabbedPane.getSelectedIndex() = 0
  tabbedPane.getTabCount() = 1       ==&gt; should be 5!!!!
  </code></pre>
  
  <p>of course, 0 = 1 - 1 then bttNext was disabled. But why tabbedPane.getTabCount = 1 when it should be 5? If I change tab, it works fine returning 5.
  I didn't understand if that is a native bug from java 1.8. Is that possibile, or is there a better and logical explanation that I didn't catch?</p>
  
  <p><img src="https://i.stack.imgur.com/TETRj.png" alt="enter image description here"></p>