|
Re: grid layout problems [message #462055 is a reply to message #461865] |
Wed, 05 October 2005 12:54 |
Eclipse User |
|
|
|
Originally posted by: ddana78ar.yahoo.com.ar
> GridData data = new GridData(GridData.FILL_HORIZONTAL);
> for (int i = 0; i < label.length; i++)
> {
> label[i] = new Label(composite, SWT.NONE);
> label[i].setText("");
> text[i] = new Text(composite, SWT.BORDER);
> text[i].setLayoutData(data);
> }
Hi Darren:
you are creating only one object of GridData, you must create a new object of this class for each widget you want to set the layoutData. So, you can do that:
GridData data;
...
for (int i = 0; i < label.length; i++) {
data = new GridData();//or the style what you want
label[i] = new Label(composite, SWT.NONE);
label[i].setText("");
label.setLayoutData(data);
data = new GridData(GridData.FILL_HORIZONTAL);
text[i] = new Text(composite, SWT.BORDER);
text[i].setLayoutData(data);
}
you can see this link:
http://www.eclipse.org/articles/Understanding%20Layouts/Unde rstanding%20Layouts.htm
best regards.
|
|
|
Powered by
FUDForum. Page generated in 0.02996 seconds