title: Javafx ComboBox list contents in sorted order
body: <p>I'm trying to have a ComboBox list the contents in sorted order. I've come up with one solution, but it still has some issues.</p>
  
  <pre><code>final ObservableList&lt;String&gt; oal = FXCollections.observableArrayList();
  final SimpleListProperty&lt;String&gt; slp =  new SimpleListProperty&lt;String&gt;(oal);
  final SortedList&lt;String&gt; sl = new SortedList&lt;String&gt;(slp, (string1, string2) -&gt; {
      return string1.compareTo(string2);
  });
  
  final ComboBox&lt;String&gt; comboBox = new ComboBox&lt;String&gt;();
  comboBox.setItems(sl);
  </code></pre>
  
  <p>I can add values to OAL or SLP.</p>
  
  <pre><code>oal.addAll("cccc", "aaaa", "bbbb");
  slp.addAll("ffff", "dddd", "eeee");
  </code></pre>
  
  <p>But if I try to add values to SL, it fails.</p>
  
  <pre><code>sl.addAll("iiii", "hhhh", "gggg");
  
  Exception in thread "main" java.lang.UnsupportedOperationException
  </code></pre>
  
  <p>So of course any attempts to add values to comboBox also fail. Does anybody know a way to fix this, or is there a totally different approach to sorting the contents of the ComboBox?</p>
  
  <p>I appreciate any help here.</p>
  
  <p>I'm using Java 8u5.</p>