title: JavaFX ComboBox itemsProperty binding
body: <p>I'm pretty new to JavaFX, and just tried property bindigs. It worked fine with StringProperty, and BooleanProperty, but now I have to bind some data to a ComboBox.</p>
  
  <p>This is the line, where it dies. It's in a controller class for an FXML:</p>
  
  <pre class="lang-java prettyprint-override"><code>comboBox.itemsProperty().bind(root.itemsProperty());
  </code></pre>
  
  <p>Here is the class of root:</p>
  
  <pre class="lang-java prettyprint-override"><code>import javafx.beans.property.ObjectProperty;
  import javafx.beans.property.SimpleObjectProperty;
  import javafx.collections.ObservableList;
  
  public class SectionComboBox extends SectionControl{
  
      private final ObjectProperty&lt;ObservableList&gt; items = new SimpleObjectProperty&lt;&gt;();
      }
  
      public ObservableList getItems() {
          return items.get();
      }
  
      public void setItems(ObservableList value) {
          items.set(value);
      }
  
      public ObjectProperty itemsProperty() {
          return items;
      }
  }
  </code></pre>
  
  <p>The error log:</p>
  
  <pre><code>java.lang.NullPointerException
  at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.getIndexOfComboBoxValueInItemsList(ComboBoxListViewSkin.java:430)
  at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.updateDisplayNode(ComboBoxListViewSkin.java:376)
  at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.getDisplayNode(ComboBoxListViewSkin.java:232)
  at com.sun.javafx.scene.control.skin.ComboBoxBaseSkin.updateDisplayArea(ComboBoxBaseSkin.java:125)
  at com.sun.javafx.scene.control.skin.ComboBoxBaseSkin.computePrefHeight(ComboBoxBaseSkin.java:180)
  at javafx.scene.Parent.prefHeight(Parent.java:879)
  at javafx.scene.layout.Region.prefHeight(Region.java:1384)
  at javafx.scene.control.Control.computePrefHeight(Control.java:856)
  at javafx.scene.Parent.prefHeight(Parent.java:879)
  at javafx.scene.control.Control.prefHeight(Control.java:738)
  at javafx.scene.layout.Region.computeChildPrefAreaHeight(Region.java:1599)
  at javafx.scene.layout.AnchorPane.computeChildHeight(AnchorPane.java:296)
  at javafx.scene.layout.AnchorPane.layoutChildren(AnchorPane.java:327)
  at javafx.scene.Parent.layout(Parent.java:1018)
  at javafx.scene.Parent.layout(Parent.java:1028)
  at javafx.scene.Parent.layout(Parent.java:1028)
  at javafx.scene.Parent.layout(Parent.java:1028)
  at javafx.scene.Parent.layout(Parent.java:1028)
  at javafx.scene.Scene.layoutDirtyRoots(Scene.java:516)
  at javafx.scene.Scene.doLayoutPass(Scene.java:487)
  at javafx.scene.Scene.access$3900(Scene.java:170)
  at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2186)
  at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
  at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:461)
  at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:330)
  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
  at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
  at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>Can someone help me how can I bind it corretly, what did I missed?</p>