title: How to change order of children in JavaFX
body: <p>Is it possible to change order of Nodes in JavaFX2 children list? I tried <code>set()</code> and <code>Collections.swap()</code> however both throw <code>IllegalArgumentException</code> in <code>Parent</code> as in some point the children list contains the same item at two positions (when node is at new position and has not been removed from the old position). There are flags inside Parent which JavaFX uses internaly in <code>toFront()</code> and <code>toBack()</code> which prevents the exception, however there is no way to access them from outside.</p>
  
  <pre><code>java.lang.IllegalArgumentException: Children: duplicate children added: parent = HBox@1424bf0
      at javafx.scene.Parent$1.onProposedChange(Parent.java:307)
      at com.sun.javafx.collections.VetoableObservableList.set(VetoableObservableList.java:156)
      at com.sun.javafx.collections.ObservableListWrapper.set(ObservableListWrapper.java:281)
      at java.util.Collections.swap(Collections.java:532)
  </code></pre>