question: public static void markText ( JTextComponent pane , int start , int end , SimpleMarker marker ) { try { Highlighter hiliter = pane . getHighlighter ( ) ; int selStart = pane . getSelectionStart ( ) ; int selEnd = pane . getSelectionEnd ( ) ; if ( selStart == selEnd || end < selStart || start > selStart ) { hiliter . addHighlight ( start , end , marker ) ; return ; } if ( selStart > start && selStart < end ) { hiliter . addHighlight ( start , selStart , marker ) ; } if ( selEnd > start && selEnd < end ) { hiliter . addHighlight ( selEnd , end , marker ) ; } } catch ( BadLocationException ex ) { LOG . log ( Level . SEVERE , null , ex ) ; } }
target:  add highlights for the given region on the given pane