Reputation: 542
Is it possible to highlight some parts of text in JEditorPane
, when I have a list of Strings to highlight?
Using HTML tags is not possible (text will contain some tags).
Is creating cutstom EditorKit
necessary?
Thanks
Upvotes: 3
Views: 780
Reputation: 57421
getHighlighter().addHighlight(start, end,
new DefaultHighlighter.DefaultHighlightPainter(Color.red));
Upvotes: 4