mary jane
mary jane

Reputation: 542

Highlighting inside JEditorPane

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

Answers (1)

StanislavL
StanislavL

Reputation: 57421

getHighlighter().addHighlight(start, end, 
             new DefaultHighlighter.DefaultHighlightPainter(Color.red));

Upvotes: 4

Related Questions