Win a copy of Java Challengers this week in the Java in General forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Please help Everyone!!

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic