This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 19338

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