Plain text in JLabel using HTML

Hi!

I've got a little problem with html and JLabel, so here it is:

I want to create JLabel component that consists of 2 parts:

the first one will be bold and the second will be normal (plain)

and that's a problem

just try it:

jLabel1.setText("<html> <b> bold text</b> plain text</html> ");

As you can see, there is no plain text written as a result and i really don't know WHY? :(

Can anybody please help me?

[517 byte] By [kvasooa] at [2007-11-26 22:42:57]
# 1
here is a hint: jLabel1.setText("<html> bold text plain text</html> "); Try it!You should change the font firstMessage was edited by: Andriuwko
Andriuwkoa at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 2
probably you don't understand me - I want do something like this:bold text plain textand this shoud be written in one JLabelbut thanks for effort
kvasooa at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 3
Okay, the default font is already bold.You have to change font of JLabel first.
Andriuwkoa at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 4
Forgot to mention, that you can also can change your lookAndFeel.And everything should be ok. If lookAndFeels default font is not bold.
Andriuwkoa at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 5
Chances are your label is simply displayed too small to contain the text - JLabel doesn't clip HTML text with an ellipsis in the same way that it does plain text.
itchyscratchya at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 6
> Okay, the default font is already bold.> > You have to change font of JLabel first.thanks al lotthat works!but jBuilder shows, that the default font is PLAIN, so ....
kvasooa at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...
# 7
As you can see, there is no plain text written as a resultOh. So what you meant was that "plain text" is written as a result, it's just written in bold.
itchyscratchya at 2007-7-10 11:58:55 > top of Java-index,Desktop,Core GUI APIs...