Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JTextArea font color

807603Jan 9 2008 — edited Jan 10 2008
I am making a logger for my code when sending data on the network. my logger is seen on a jtextarea. what i want is to change the color of a particular line when it encounters errors like exceptions to give emphasis on critical matters. Just like the "Output" in netbeans wherein there are different colors. Red text for exceptions, blue text for successful, black text for normal operations.

I tried to use this

jtextarea.setFont(new Font()) //forgot the parameters... : ) with color red for exceptions but the whole texts all turns to red...

any idea how? tnx in andvance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2008
Added on Jan 9 2008
5 comments
313 views