Friday, 6 September 2013

JavaFX - changing order of children in a FlowPane

JavaFX - changing order of children in a FlowPane

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

No comments:

Post a Comment