How to change the style of String in SWT?
-
30-09-2019 - |
Pergunta
I develop some features based on Eclispe GEF.
I want to create a label with some string. for example: new Label("This is a good test stensece")
Now, I want to get these effects "good" is in Bold font, and "test" is in italic. It looks like can use some HTML way to implement that
So,is there any one knows that?
Thank you very much!
Solução
If you don't want to use StyledText, you could create multiple labels based on substrings of the original string, then use
labelName.setFont(Font font);
on each label to create different fonts for each portion.
Outras dicas
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow