1

I am very new to using StyledText, TextStyle.

I am trying to give a hyperlink look for a text that is displayed. I am using TextStyle object to create a hyper link style text. For TextStyle constructor I am passing Font object which has the style SWT.UNDERLINE_LINK, expecting it to create a text with hyperlink style [as per javadoc].

I am not able get this style working. Other styles SWT.BOLD, SWT.ITALICS works but not SWT.UNDERLINE_LINK. Are there any special conditions to use SWT.UNDERLINE_LINK?

jbihan
  • 3,053
  • 2
  • 24
  • 34
prakashjv
  • 329
  • 2
  • 8
  • 16

2 Answers2

2

Check this Thread- Can HTML-Style Links be added to SWT StyledText?

and http://www.roseindia.net/tutorials/swt/create-link.shtml

Community
  • 1
  • 1
Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128
1

You need to set

styleRange.underline = true;

when using the underlineStyle

styleRange.underlineStyle = SWT.UNDERLINE_LINK;
AndreasB
  • 309
  • 2
  • 10