
Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
>> JTextArea.setForeground() sets the font color for the entire component,
>> but how can I have different font colors in the same area?
>
> Use HTML in a (non editable) JEditorPane. Alternately you might
> look to a JTextPane and manipulate the document attributes.
I find this slightly misleading. There is virtually no difference
between JEditorPane and JTextPane and you may as well use either
HTML or the simple default styled text with both. As the minor
additional features of JTextPane aren't sufficient for serious
work, I would use JEditorPane, and, if editing is required,
transplant the basic input attribute logic there.
Christian
Andrew Thompson - 31 Dec 2004 23:59 GMT
>>> JTextArea.setForeground() sets the font color for the entire component,
>>> but how can I have different font colors in the same area?
[quoted text clipped - 8 lines]
> work, I would use JEditorPane, and, if editing is required,
> transplant the basic input attribute logic there.
Thanks for clarifying Christian. I was unsure whether to mention
JTextPane since I myself had never found a use for one. (I should
have stuck with my instincts on that one!)

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane