mahee
mahee

Reputation: 530

Vertical scroll bar for SWT list widget

Following is my code:

Group leftGroup = new Group(parent, SWT.NONE);

leftListWidget = new org.eclipse.swt.widgets.List(leftGroup,
            SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);

leftListWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

From the above code I though that that if I added V_SCROLL AND H_SCROLL, it would add both horizontal and vertical scroll bar in my list widget. However I cannot see any scroll bar. When I increase the number of records in the list, it just increases the size (length) of the list. Is it a problem with scrolling OR with setting the length of list widget?

Upvotes: 5

Views: 4101

Answers (1)

Cristiano Ghersi
Cristiano Ghersi

Reputation: 2122

This is the course of list in SWT!!!

You need to create your own widget (check i.e. http://www.snip2code.com/Snippet/11489/Custom-SWT-List-Box) and manage there you scrollable components.

Upvotes: 4

Related Questions