Custom alignment of SWT widgets inside Composite
Hi Friends,
I have create a Composite object as follows.
Composite comp = new Composite(parent, SWT.NONE);
GridLayout gl = new GridLayout();
gl.numColumns = 2;
gl.verticalSpacing = 15;
gl.horizontalSpacing = 10;
gl.marginWidth = 20;
comp.setLayout(gl);
I want to create 4 rows with one label and one text box. It worked fine for me.
Now in the last row I want to display a label, Text box and a Button.
The 4 rows were created with code something similar to given below.
// Create a label and text box for the host
Label myLabel = new Label(comp, SWT.NONE);
myLabel.setText("Info: ");
myText = new Text(comp, SWT.BORDER);
myText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
I tried by increasing numColumns of Grid Layout, which resulted in label of
next row appearing in current row. Can anyone suggest the solution please ?
Thanks,
Subbarao