문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top