Reputation: 36143
I have a composite that contains two child composites
+---+---+ | 1 | 2 | +---+---+
How can I change the order of these two composites when the user clicks a button? Result should be:
+---+---+ | 2 | 1 | +---+---+
Thanks Simon
Upvotes: 0
Views: 1661
Reputation: 3085
Control.moveAbove() and Control.moveBelow() works for changing order of controls in Composite children(). Parent composite should be done re-layout to compute new bounds for children.
Upvotes: 1
Reputation: 1497
Control class has methods moveAbove() and moveBelow(), I think these two are doing exactly what you need
Upvotes: 4
Reputation: 36894
I think this answers your question: Change the order of element in RowLayout SWT Java
It basically says, that there is a z-order
you can use to position your components.
Upvotes: 3