• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Text Area..please help urgent

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic