Java SWT make a Label Scrollable

Tags: , ,

I have a Label in a Group in SWT and if it contains many lines of text, I would like to make it scrollable vertically. Setting the style parameter with SWT.V_SCROLL doesn’t seem to do it. How can I do this?


Label does not support scrolling.

You could use a read only Text control which will scroll:

Text text = new Text(parent, SWT.READ_ONLY | SWT.V_SCROLL);

Source: stackoverflow