File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes changing the color of one char Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "changing the color of one char" Watch "changing the color of one char" New topic

changing the color of one char

Ran Togo

Joined: Mar 13, 2006
Posts: 3
is there a way to change the color of only one char in TextArea?
for example, the first char in a string is blue while the rest of the string is in black.
I don't want to use JEditor nor Jlable. I want to change the char in the TextArea.
[ May 19, 2006: Message edited by: Ran Togo ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

No. If you want to render parts of your text differently from other parts, you have to use a JTextPane or a JEditorPane.
I agree. Here's the link:
subject: changing the color of one char
It's not a secret anymore!