Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java SWT make a Label Scrollable

Tags:

java

label

swt

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?

like image 264
chis54 Avatar asked Sep 28 '26 09:09

chis54


1 Answers

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);
like image 194
greg-449 Avatar answered Sep 30 '26 02:09

greg-449



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!