title: How do you attach a listener to a JavaFX spinner?
body: <p>I've run into what seems (to me, anyway) an odd problem with JavaFX spinners and not being able to attach any kind of listener to it.  </p>
  
  <p>I'm used to Swing programming, where I can attach a ChangeListener to a JSpinner and receive events that way, but JavaFX doesn't seem to have anything like that.  </p>
  
  <p>The code in question...</p>
  
  <pre><code>    IntegerSpinnerValueFactory spinnerValueFactory = new SpinnerValueFactory.IntegerSpinnerValueFactory(0, Integer.MAX_VALUE); 
  
      hullPointsSpinner = new Spinner&lt;Integer&gt;(spinnerValueFactory); 
      hullPointsSpinner.setEditable(true);
  
      ((TextField)hullPointsSpinner.getEditor()).setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          public void handle( ActionEvent event )
          {
          System.out.println("Howdy, folks!  Value is " + hullPointsSpinner.getValue() + "!!"); 
          }
      });
  </code></pre>
  
  <p>The arrow buttons will increase and decrease the value in the field, but have no effect on the value in the model.  Only selecting the contents of the field and pressing enter will actually update the data in the model and prints out the value. (The pressing enter thing is in the documentation, I know.)</p>
  
  <p>I also realize that I'm putting that EventHandler onto the Spinner's TextField with getEditor, but I have yet to see another way to do this.  </p>
  
  <p>Is there a way to hook a listener to the spinner's buttons?<br>
  (Heck, is there even a way to get at those buttons to attach a listener?)</p>
  
  <p>Am I receiving the wrong type event from the spinner/editor?
  Can I put some kind of listener on the spinnerValueFactory?<br>
  Is there some kind of obvious solution that I'm overlooking here?  </p>
  
  <p>I'll replace this with a JSpinner, if necessary, but it just seems crazy to me that this API would have a spinner component and such an awkward way to use it.</p>
  
  <p>Thanks in advance.</p>