开发者

How to change the style of String in SWT?

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!


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.


StyledText! http://www.eclipse.org/articles/StyledText%201/article1.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜