Reputation: 15
these are just sample codes. I created a GridLayout composite and removed the margins. But there are still spaces in between the rows.
Composite composite = new Composite(shell, SWT.NONE);
GridLayout gl_composite = new GridLayout(1, false);
gl_composite.marginWidth = 0;
gl_composite.marginHeight = 0;
composite.setLayout(gl_composite);
Composite composite_1 = new Composite(composite, SWT.BORDER);
GridData gd_composite_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_composite_1.heightHint = 52;
gd_composite_1.widthHint = 802;
composite_1.setLayoutData(gd_composite_1);
composite_1.setLayout(new GridLayout(1, false));
Composite composite_2 = new Composite(composite, SWT.BORDER);
GridData gd_composite_2 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_composite_2.widthHint = 803;
composite_2.setLayoutData(gd_composite_2);
I need the rows to not have any spaces in between. The composites are bordered since I need to have a line below . I'm new to SWT so..
Thanks!!
Upvotes: 0
Views: 1215
Reputation: 111142
The verticalSpacing
field of GridLayout
sets the spacing between rows, so:
gl_composite.verticalSpacing = 0;
Use horizontalSpacing
for spacing between columns.
The default for both values is 5
Upvotes: 1