Java SWT link widget – how do I delete hyperlink underscores?
•
Java
I know we can use:
setText("<a> href="url"> Link </a>");
Create a link But this is emphasized
I want a link without underline, so I tried
setText(<a> href="url" style="text-decoration: none" Link </a>);
But it still doesn't work Any help?
Solution
Well, you can't delete the underline It is drawn internally with the help of the textlayout class and cannot affect the behavior By the way, the HTML code of the text widget is only used internally for parsing In fact, the link widget does not have HTML support This is why the style attribute does not work However, you can use the styledtext widget for more advanced text layout
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码