문제

OK - I give up.

How can I set width and height of a JFace ListViewer?

This should be self-evident but can't seem to find anything and there's no obvious way of doing it looking at the methods of the class.

Tried this with no luck:

myListViewer.getControl().setSize(1000, 1000);

Any help appreciated.

도움이 되었습니까?

해결책

You don't set the size explicitly. you use layouts instead. Layouts manage the size and position of your widgets in a container. Read this eclipse article that will help you understand SWT layouts.

다른 팁

To do this you can set a layoutdata to your List associated with the ListViewer

myListViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

to resize the control to fill the cell horizontally and to fit the remaining horizontal space.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top