Constructor for class Font:
(http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html)
Font(String name, int style, int size)
what about color? how to set Font Color?
I'm working w/JTextArea, now realized need to use JTextPane b/c will
need diff. font colors depending on user input.. (nothing fancy, no
images, no HTML (at least I don't think I need to do w/html..) all font
attr's will remain constant, only font color will change.. (also would
like if user inputs url for it to be a link..)
I have just spent entire evening looking this up... is not that
simple....;) I'm going a bit dizzy... ;)
thank you for any help...
Christian Kaufhold - 28 Aug 2005 11:36 GMT
Hello!
> what about color? how to set Font Color?
Fonts do not have color. The color is a separate attribute when some
text is actually painted.
> I'm working w/JTextArea, now realized need to use JTextPane b/c will
> need diff. font colors depending on user input.. (nothing fancy, no
> images, no HTML (at least I don't think I need to do w/html..) all font
> attr's will remain constant, only font color will change.. (also would
> like if user inputs url for it to be a link..)
textArea.setForeground
Christian
Roedy Green - 29 Aug 2005 08:38 GMT
>what about color? how to set Font Color?
In paint you do a Graphics.setColor().
In Components you do Component.setForeground and
Component.setBackground.
Font objects themselves do not have a colour.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.