jQuery in Action, 3rd edition
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 19755

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: http://aspose.com/file-tools
subject: changing the color of one char
It's not a secret anymore!