title: Preventing negative values in jSpinner
body: <p>I am using netbeans to build gui application in java.  It has a jSpinner. I set its minimum value to 0.  When i run and click on the down arrow button, i am getting, negativearraysizeexception.  Any solution to this?</p>
  
  <p>//This code is autogenerated in netbeans</p>
  
  <pre><code>protected void fireStateChanged() {
      Object[] listeners = listenerList.getListenerList();
      for (int i = listeners.length - 2; i &gt;= 0; i -= 2) {
          if (listeners[i] == ChangeListener.class) {
              if (changeEvent == null) {
                  changeEvent = new ChangeEvent(this);
              }
              ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);
          }
      }
  }
  </code></pre>