title: LinkedHashMap and MapProperty
body: <p>I am learning JavaFX and I am rewriting my application from Swing to JavaFX.</p>
  
  <p>Now I am facing this problem.</p>
  
  <p>In Swing I selected data from database, I saved them into ResultSet and from ResultSet I inserted them into LinkedHashMap.</p>
  
  <p>From LinkedHashMap I inserted them into ComboBox in the same order.</p>
  
  <p>The same order is important.</p>
  
  <pre><code>// Swing
  private final LinkedHashMap&lt;Integer,String&gt; linkedHashMap = new LinkedHashMap&lt;Integer,String&gt;();
  ... // ResultSet
  while(rs.next()){
          linkedHashMap.put(rs.getInt(1), rs.getString(2));
      }
  ... // ComboBox
  Iterator it=linkedHashMap.values().iterator();
  while(it.hasNext()){
          String value=(String)it.next();
          jComboBox.addItem(value);
      }
  ...
  </code></pre>
  
  <p>In JavaFX I rewrited LinkedHashMap into MapProperty but I do not know how I can hold data in the same order? After insert to ComboBox data are not in the same order.</p>
  
  <pre><code>// JavaFX
  private final MapProperty&lt;Integer, String&gt; observableHashMap = new SimpleMapProperty&lt;&gt;(FXCollections.observableHashMap())
  ... // ResultSet
  while(rs.next()){       
          observableHashMap.put(rs.getInt(1), rs.getString(2));
      }
  ... // ComboBox
  this.getComboBox.getItems().clear();
  this.getComboBox().getItems().addAll( observableHashMap.values() );
  ...
  </code></pre>
  
  <p>How can I hold data in MapProperty in the same order?</p>
  
  <p>Does have sense use Property for data which I use for select only?</p>