aspose file tools
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextArea - more than one color" Watch "JTextArea - more than one color" New topic
Author

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
Thanx
Shiva.
Sudha Lakshman
Greenhorn

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
regards
sudha
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.
Shiva.
Mr IT
Greenhorn

Joined: Dec 03, 2001
Posts: 1
Hi,
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 http://www.javaranch.com/ubb/Forum2/HTML/000513.html, I hope this helps......GOOD LUCK !!
 
jQuery in Action, 3rd edition
 
subject: JTextArea - more than one color
 
It's not a secret anymore!