Currently I'm using a JTextArea for a chat program. 1. My idea it to set different color in the text. Eg. Red color for the user's name and black for his/her msg. Or green when some1 enters the chat server. (ie something like what we see in irc). 2. Also, I want the scrollpane to be always scrolled to view the latest msg. Any means I can achieve them?