In my application, I use a JTextPane to display some log information. As I want to hightlight some specific lines in this text (for example the error messages),
JTextPane
No need to use the ParserCallback. Just use:
textPane.getDocument().getText(0, textPane.getDocument().getLength()) );