Layout label and combo in fixed size window [message #729540] |
Mon, 26 September 2011 09:03  |
Eclipse User |
|
|
|
I want to layout a label and a combo on a single row. The situation is like this:
GridLayout gridLayout = new GridLayout( numColumns, makeColumnsEqualWidth);
parentComposite.setLayout(gridLayout);
Label label = new Label( parent, SWT.NONE );
label.setText("Label1");
label.setLayoutData( new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Combo combo = new Combo( parent, SWT.NONE );
combo.setLayoutData( new GridData(SWT.FILL, SWT.DEFAULT, true, false);
combo.add("-----------------------------------------------------------------");
combo.select(0);
With a fixed window size, for example 500x300 I expect the label and the combo to layout correctly in the space without any overlap. The problem is in this case the combo takes all the space in order to show as much as possible of the text.
Is there a way to solve this solely with layouts, I mean, without using setPreferredSize?
Thank you.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04448 seconds