user1365697
user1365697

Reputation: 6009

How to move next line in Label?

I have Label in SWT The text is

     "Doctor\ntest\ttest2"

I want to change it to

       "Doctor
       test     test2"

menaing to change the \n to new line and \t to tab. Can I do it in Label in SWT? Do I need to change the control ?

Upvotes: 0

Views: 1138

Answers (1)

Mirco
Mirco

Reputation: 3016

You can do this in the label control.

final Label label = new Label(composite, SWT.NULL );
label.setText( "Line one \n line two  abc \t tabbed" );
label.pack();

Results in: enter image description here

You can also do this by using a Text-Control and set it disabled.

Upvotes: 2

Related Questions