• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help Everyone!!

 
asheet anand
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,
i am making a chat server application.my requirement is i want
to display the private message in red color.
i am making a java light chat,all the messsages are displayed
in the main window along with the private message.i want
to display the private message in that textarea in red color
and all the other messages in black color.
please help me
asheet anand
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Asheet,
I have searched through Sun's forums to find an answer to your question. You do not mention whether or not you are using Swing. If you are, most people seem to recommend using a JTextPane to allow for multi-color text.
If you are using AWT, I did not find any pre-built control that would allow you to display multi-color text as you describe. I think you would probably have to override Panel or Canvas and create your own multi-color text area.
Hope this helps.
Stephanie
 
asheet anand
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks stephanie,
i am making my chat using awt. irequest to t please tell me the
code to create a multi-colored text area with the method
you talk about.
it will be a grat help to me!!
thanks asheet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic