title: JavaFX - changing order of children in a FlowPane
body: <p>I have got a JavaFX 2.2 FlowPane and want it's children to be change their order on demand.</p>
  
  <p>I found out that</p>
  
  <pre><code>Collections.sort( getChildren(), new Comparator(){...} );
  </code></pre>
  
  <p>causes the exception</p>
  
  <pre><code>java.lang.IllegalArgumentException: Children: duplicate children added: parent = ...
  </code></pre>
  
  <p>I also tried to sort using the child Nodes toFront() method (as suggested here <a href="https://stackoverflow.com/questions/17761415/how-to-change-order-of-children-in-javafx">How to change order of children in JavaFX</a>), but this does not seem to influence the list order.</p>
  
  <p>Is there anything else I could try or are children in a scene graph unmutable regarding their order?</p>