Hi. now i'm coding chat client applet.I want to display different color for different user's message.But for some reason,i can not use Swing package. And i know it's pretty difficult to code such component from scratch. So i want to know where i can find such component?? Thanks for your talent and kindness!!
All components have a setForeground method. All TextComponents have a setBackground method. Why not just use a TextArea. TextArea message = new TextArea(); int r = 20; //any number from 1 to 256 int g = 256; int b = 100; Color userColor = new Color(r, g, b); message.setBackground(userColor); or (alternate syntax) message.setForeground(new Color(28, 159, 200)); you can fiddle with the number combinations to get a whole bunch of shade variations. Of course you would need a different TextArea for each message. You can't change the colors for just a PART of the text / background.
[This message has been edited by Cindy Glass (edited February 20, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara