private void outputSearch(JTextPane toSearch, JTextField entry,
			boolean ignoreCase) {
		Highlighter hilit = new DefaultHighlighter();
		toSearch.setHighlighter(hilit);
		Highlighter.HighlightPainter painter = new DefaultHighlighter.DefaultHighlightPainter(
				HILIT_COLOR);

		final String s = entry.getText();

		try {
			final String content = toSearch.getDocument().getText(0,
					toSearch.getDocument().getLength());

			int index = -1;
			if (ignoreCase) {
				index = content.toLowerCase().indexOf(s.toLowerCase(), 0);
			} else {
				index = content.indexOf(s, 0);
			}

			if (lastIndex != 0 && lastIndex >= index) {

				if (ignoreCase) {
					final int tempIndex = content.toLowerCase().indexOf(
							s.toLowerCase(), lastIndex + 1);
					index = tempIndex;
				} else {
					final int tempIndex = content.indexOf(s, lastIndex + 1);
					index = tempIndex;
				}

			}

			if (index >= 0) { // match found
				final int end = index + s.length();
				hilit.addHighlight(index, end, painter);
				toSearch.setCaretPosition(index);
				lastIndex = index;
			} else if (lastIndex > 0) {
				lastIndex = 0;
			} else {
			}

		} catch (final BadLocationException e) {
			e.printStackTrace();
		}

	}