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!

Multi-colored JLabel! Is this possible?

800401Feb 5 2009 — edited Feb 6 2009
Hi all

I would like to present a String on a JLabel component using different colors for different parts of it.
It will contain a URL like www.xxzzzxxxx.com where I would like to color xxzzzxxxx in red and leave
the rest in the default color.

Is this possible? Can you show how in a small piece of code?

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2009
Added on Feb 5 2009
9 comments
1,306 views