It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes Keeping a Color over a socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Keeping a Color over a socket" Watch "Keeping a Color over a socket" New topic

Keeping a Color over a socket

Mark Thomas

Joined: Feb 09, 2002
Posts: 4
I have a chat server I authored from code I modified from an IBM tutorial. I have a options in a menubar that allow users to change their text color and background color, but I want the color of each individual user to be displayed on every other users display. Right now the option changes all the text to the chosen color from the menubar and I want it to only change that user's text color and not the other users. Right now I am writing user comments to a TextArea. The only solution I could think of was to pass the user color through the socket with the message and use a Canvas or Panel instead of a TextArea so I could set the Color and then draw the message to the Canvas. Does anyone have a better solution?
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Why would I as a user want some other user controlling my colors? Also, say for some reason I choose red as my background color. Some other user can choose red for the text? I don't see why you would want another user to control color on other users side of the app.
I agree. Here's the link:
subject: Keeping a Color over a socket
It's not a secret anymore!