my dog learned polymorphism*
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
Author

changing the color of one char

Ran Togo
Greenhorn

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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

No. If you want to render parts of your text differently from other parts, you have to use a JTextPane or a JEditorPane.
 
wood burning stoves
 
subject: changing the color of one char