title: Binding a Label's text property (in an FXML file) to an IntegerProperty (in a controller)
body: <p>I've set up a data binding between a Label in an FXML file and an IntegerProperty in the associated controller. The problem is that, while the label gets set to the correct value upon initialization, it is not updating when the property's value changes.</p>
  
  <p><strong>FXML file</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.net.*?&gt;
  &lt;?import javafx.geometry.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  
  &lt;GridPane xmlns:fx="http://javafx.com/fxml"
     fx:controller="application.PaneController" minWidth="200"&gt;
     &lt;Label id="counterLabel" text="${controller.counter}" /&gt;
     &lt;Button translateX="50" text="Subtract 1"
        onAction="#handleStartButtonAction" /&gt;
  &lt;/GridPane&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>package application;
  
  import java.net.URL;
  import java.util.ResourceBundle;
  
  import javafx.beans.binding.Bindings;
  import javafx.beans.property.*;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
  
  public class PaneController implements Initializable
  {
      private IntegerProperty counter;
  
      public int getCounter()
      {
          return counter.get();
      }
  
      public void setCounter(int value)
      {
          counter.set(value);
      }
  
      public PaneController()
      {
          counter = new SimpleIntegerProperty(15);
      }
  
      @Override
      public void initialize(URL url, ResourceBundle resources)
      {
      }
  
      @FXML
      private void handleStartButtonAction(ActionEvent event)
      {
          setCounter(getCounter() - 1);
          System.out.println(getCounter());
      }
  }
  </code></pre>
  
  <p><strong>Expectation</strong></p>
  
  <p>Each time I push the "Subtract 1" button, the counter will decrement by 1, and the counterLabel will update automatically.</p>
  
  <p><strong>Reality</strong></p>
  
  <p>The counter does decrement by 1, but the counterLabel remains stuck at 15 (the initial value).</p>
  
  <p><strong>Question</strong></p>
  
  <p>I was under the impression (e.g., from <a href="https://forums.oracle.com/message/10476076">this forum post</a>) that what I've done should work. What am I missing?</p>