Originally posted by Jack Conger:
I'm making a program that utilizes a frequently updated multi lined text component, which is currently not in color. And I'd like to make it in color. I've tried to read stuff on JEditorPane and using setContentType() and all that, and a little JTextPane stuff, but all of it makes my head spin. Any help would be appreciated.
P.S. The JTextArea I'm using uses a lot of append()s.
It's possible to use highlighters as Mr. Prime suggests, but this
is what JTextPane was made for. It need not make your head spin.
For instance, here's a
simple example that appends colored text.
disclaimer: I wrote that example. That site took it from
my book.
It's from chapter 22, which is a hundred-page introduction to
JTextPane and AttributeSets. You can read part of it at
Google Books (click on "more �" under "Contents", then on
"Styled Text Panes") but some pages are missing. My publisher
would prefer you purchased the book.