posted 11 years ago
To continue on this thought.......
I have my JTextPane working, all of my output looks good, so now I am trying to extend my knowledge. Is there a way to change the font color of individual words? I see how to change the color of everything in the Pane, but I want more granularity. For example, to add emphasis to a result such as:
The number of comparisons was 412
Can color specs be added to a Style or a SimpleAttributeSet, so whenever that Style (or SimpleAttributeSet) is used, the text is colored? It would seem to be a simple solution if I could just apply a Style to the outputting of that variable that resolves to 412, but I don't know if that is possible.
Cheers
BD
I've got just enough Java knowledge to royally screw everything up. :-)