- May 11, 2005
- 641
- 0
- 0
Greetings.
This is regarding a chat program I am making.
So far it is a pretty standard program:
JTextPane to make message (inc smilies), which is transferred to all clients in the form of a String - : ) = Smiley face etc.
The problem is displaying it over at the other end.
The only way I can see this being done is splitting the message at ever ":" and checking the character after to see if it is a valid smiley code. But I am having problems dealing with if a user just entered a : or :nkjfgfg etc.
Is there a better way I can do this - Or will I just have to code some extensive logic to decide what to display. Is there no way to append a styed document to a JTextPane?
I hope I have made my problem clear.
This is regarding a chat program I am making.
So far it is a pretty standard program:
JTextPane to make message (inc smilies), which is transferred to all clients in the form of a String - : ) = Smiley face etc.
The problem is displaying it over at the other end.
The only way I can see this being done is splitting the message at ever ":" and checking the character after to see if it is a valid smiley code. But I am having problems dealing with if a user just entered a : or :nkjfgfg etc.
Is there a better way I can do this - Or will I just have to code some extensive logic to decide what to display. Is there no way to append a styed document to a JTextPane?
I hope I have made my problem clear.
