Reputation: 2595
I'm writing a Text comparing tool and would like to show the charaters who are not same in Red.
Thatfor I have to change the Color (with setForeground()
?) of a Passage of the Text.
How can I do that?
Upvotes: 0
Views: 142
Reputation: 57381
You can use "< html>Some text< font color...>some text< /font>< /html>" for the cell's text.
Upvotes: 1
Reputation: 15628
Instead of labels you will need to use a JEditorPane as your rendering component.
Look here for inspiration: How to insert JEditorPane into JTable cell?
Upvotes: 1