Simon Martinelli
Simon Martinelli

Reputation: 36143

SWT composite ordering in layout

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

Answers (3)

sambi reddy
sambi reddy

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

Jan Hruby
Jan Hruby

Reputation: 1497

Control class has methods moveAbove() and moveBelow(), I think these two are doing exactly what you need

Upvotes: 4

Baz
Baz

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

Related Questions