Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can a JLabel be colored in two colors?

843805Feb 28 2007 — edited Mar 2 2007
Hello,

I want to color the font of a jlabel in two colors. For example: The text is "hello bye". The hello needs to be red and the bye needs to be black.
Is there a possibility to do that without using HTML (I tried an html text inside the jlabel, and it does work, but it changes the layout in the jlabel).

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2007
Added on Feb 28 2007
10 comments
163 views