I am using org.eclipse.swt.widgets.List
to add some items dynamically.
However the size of each string is larger than the default width given by the List
.
How do I recompute the size of the list each time I add a new String
into the List
?
Edit 1
Sorry for the naivety of the question, still a novice to SWT.
This is how I have created it:
Group parentGrp = new Group(threeColComposite,SWT.NONE);
parentGrp.setText("Interfaces Present in Selected jar");
parentGrp.setLayout(new GridLayout(1,false));
parentGrp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
myList = new List(parentGrp, SWT.BORDER | SWT.V_SCROLL | SWT.MULTI);
myList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
I haven't used a separate layout for the list
as it was the only child of the parent group. Is it wrong if a layout hasn't been used?
Edit 2
@Baz: I have used the snippet from your answer here from the createMiddleContent()
method