Results 1 to 3 of 3
Thread: Varying colors within JTextArea
- 03-27-2010, 06:39 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 81
- Rep Power
- 0
Varying colors within JTextArea
Reading through the Java tutorials, it states that "[i]a given text area can display text in only one font and color.[i]" Is there any way to get around this?
I have a JTextArea that is going to be a chat pane and would like the chat to appear with different color codings and possibly alternating boldface for time, username, and text. For example,
[14:09] Psyclone: Insert message here.
I know other programming languages can pull this off. Can it be done through JTextArea though?
-
I know of two solutions:
One, to use JTextArea and HTML code to help with the different colors. -- edit: incorrect!
The other is to use JEditorPane or JTextPane.
edit: I'm incorrect about my first suggestion.Last edited by Fubarable; 03-27-2010 at 06:57 PM.
- 03-27-2010, 06:56 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 81
- Rep Power
- 0
Similar Threads
-
JTextArea on PopUp -JTextArea isn't editable
By Richy76 in forum AWT / SwingReplies: 3Last Post: 02-01-2010, 07:51 PM -
In Case You Want Colors!
By angryboy in forum Forum LobbyReplies: 0Last Post: 08-29-2009, 10:06 PM -
Colors and shapes.
By Torgero in forum New To JavaReplies: 14Last Post: 10-13-2008, 05:25 PM -
Displaying a Button with Varying Icons
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:40 PM -
how to set multiple colors in a JtextArea
By valery in forum AWT / SwingReplies: 2Last Post: 08-01-2007, 05:12 PM
Bookmarks