title: JSpinner with a SpinnerNumberModel always returns value 0
body: <p>I made a <code>JSpinner</code> component with a <code>SpinnerNumberModel</code> as model like this:</p>
  
  <pre><code>JSpinner spinbox = new JSpinner(new SpinnerNumberModel(2, 1, 7, 1));
  </code></pre>
  
  <p>I added a listener to detect changes.</p>
  
  <pre><code>spinbox.addChangeListener(new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent arg0) {
          synchronized (this) {
              System.out.println("New value: " +
                ((Integer)_spiNumOfAIs.getValue()).intValue());
          }
      }
  });
  </code></pre>
  
  <p>All I see, however, is this:</p>
  
  <blockquote>
    <p>New value: 0</p>
    
    <p>New value: 0</p>
  </blockquote>
  
  <p>Am I reading out the value of the spinbox incorrectly?</p>
  
  <p>In case you're wondering about the <code>synchronized</code> block: I'm new to Swing and I don't know whether action listeners are executed on the same thread where I created my <code>JDialog</code> or not, so I put in thread safety measures for all action listeners to be safe. <code>_spiNumOfAIs</code> is a member variable.</p>
  
  <p><strong>Edit</strong>: even from this small code snippet it's so obvious that I didn't even see it... while refactoring I forgot that I'm using both a <code>JSpinner spinbox</code> and a <code>JSpinner _spiNumOfAis</code>, with the former being the spinner that is visible in the GUI.</p>