How would I color text in a JEditorPane based on what the word is in an efficient and effective way? I tried searching it, but the best way I've seen is to use the <font> HTML tag. Which is soon followed by a disclaimer that it is not very efficient.
A good example of what I want to is like the editor Eclipse, which color the keywords.
I've only done this once. Here we append a message in a color based on an event type:
I don't know about efficiency ... try one approach or the other and see how it performs. Chances are pretty good this won't be the bottleneck in your system. [ August 24, 2007: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi