Forums Register Login

JTextArea - more than one color

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Hi Sudha,
Hey ! For that kind of application i am posted this question. If u got any answer pls let me know.
Shiva.
+Pie Number of slices to send: Send
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 !!
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1530 times.
Similar Threads
How to display more than one text colors in JTextArea?
How do you set the color of an array List of JTextArea
Wanna color some words in my JTextArea- -urgent
Multi-color JTextAreas
Color text in JTextArea
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:10:50.