I have a composite A, which should contains another composite B.
Composite B will change it's size.
What layout should I apply to composite A, so that it will wrap composite B automatically?
I think that a GridLayout will work for you but keep in mind that you have to tell compositeB to SWT.FILL not the other way around:
Composite compositeA = new Composite(parent, SWT.NONE);
compositeA.setLayout(new GridLayout(1, false));
Composite compositeB = new Group(compositeA, SWT.NONE);
compositeB.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With