Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 424
mary jane Avatar asked Mar 15 '26 21:03

mary jane


1 Answers

getHighlighter().addHighlight(start, end, 
             new DefaultHighlighter.DefaultHighlightPainter(Color.red));
like image 176
StanislavL Avatar answered Mar 18 '26 09:03

StanislavL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!