• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text Area..please help urgent

 
Elizabeth Luckose
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am working on a chat program. I am appending the messages to a TextArea in an applet. I want to show the messages in different colors as they are appended to the text area. If I call setForeground for the textarea, the messages already appended to the textarea are changed to the new color. How can I prevent this and show only the message that is appended after calling setForeground()be shown in that color? Is there any other way?
Please help...urgent
Thanks,
Elizabeth
 
Helmut Lerch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Elizabeth Luckose:
Hi
I am working on a chat program. I am appending the messages to a TextArea in an applet. I want to show the messages in different colors as they are appended to the text area. If I call setForeground for the textarea, the messages already appended to the textarea are changed to the new color. How can I prevent this and show only the message that is appended after calling setForeground()be shown in that color? Is there any other way?
Please help...urgent
Thanks,
Elizabeth

Since you mention TextArea I assume you are using AWT. You can't color parts of the Text differently within TextArea. You have to use swing or write your own component.
Heli
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic