This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTextArea - more than one color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextArea - more than one color" Watch "JTextArea - more than one color" New topic

JTextArea - more than one color

Shiva Kumar
Ranch Hand

Joined: Feb 09, 2001
Posts: 30
Hi all,
I want to display each line in a JTextArea in different color, whether is it possible or not, pls help me out
Sudha Lakshman

Joined: Nov 26, 2001
Posts: 17
hi shiva kumar,
have the same question. but the color set on to the text area once will be applicable for the entire text in the text area.
i wanted to implement the text area as it appears in the Yahoo chat! where each user's messages typed are in different colour. (i.e., one colour for each user)
thank you
Shiva Kumar
Ranch Hand

Joined: Feb 09, 2001
Posts: 30
Hi Sudha,
Hey ! For that kind of application i am posted this question. If u got any answer pls let me know.

Joined: Dec 03, 2001
Posts: 1
I posted a similar question that was repelied to by Jane Griscti. I also did quite a bit of research on this topic. For awt you will have to use the Canvas component and if you are using swing you can use the JTextPane. TextArea,JTextArea doesn't support mulitcolor lines. I found this old post at, I hope this helps......GOOD LUCK !!
I agree. Here's the link:
subject: JTextArea - more than one color
It's not a secret anymore!