public static void highlightTokens(JTextArea resultsPane, ArrayList<String> tokens) {
        Highlighter highlighter = resultsPane.getHighlighter();
        for (int j = 0; j < tokens.size(); j++) {
            String textFromPane = resultsPane.getText();
            for (int i = 0; i <= textFromPane.length(); i++) {
                if (textFromPane.regionMatches(i, tokens.get(j), 0, tokens.get(j).length())) {
                    try {
                        highlighter.addHighlight(i, i + tokens.get(j).length(), DefaultHighlighter.DefaultPainter);
                    } catch (BadLocationException ble) {
                        System.out.println(ble);
                    }
                }
            }

        }
    }