Results 1 to 3 of 3
- 10-27-2010, 08:04 AM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
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
-
Moved to the SWT forum.
Good luck and welcome to the Java-Forums.org! :)
- 02-16-2011, 09:49 PM #3
Member
- Join Date
- Dec 2010
- Location
- Encinitas, CA
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
getting problem in disposing the widgets
By thendral m in forum SWT / JFaceReplies: 7Last Post: 01-12-2010, 09:37 AM -
How to create widgets on some event
By sarbuland in forum Advanced JavaReplies: 0Last Post: 02-06-2008, 09:08 PM -
How to create widgets dynamically
By sarbuland in forum Advanced JavaReplies: 0Last Post: 02-06-2008, 09:08 PM
Bookmarks