public static void findText(JTextComponent section, String input) {

		// Removes the previous highlights if there were any.
		section.getHighlighter().removeAllHighlights();

		if (input.length() <= 0) {
			return;
		}
		/*
		 * Gets the text from the chosen editorpane and searches after the input
		 * from the beginning of the text.
		 */
		String content = section.getText();
		int start = content.indexOf(input, 0);
		int end;
		DefaultHighlighter.DefaultHighlightPainter painter = new DefaultHighlighter.DefaultHighlightPainter(
				Color.YELLOW);
		int matchesFound = 0;
		boolean isSearching = true;

		/*
		 * Searches for the specific word. The text is found if the index of
		 * start is larger or equal to zero. The indexes of start and end it
		 * will change so that it will be after the found word. The found word
		 * is marked by a highlighter.
		 */
		while (isSearching) {
			if (start >= 0) {
				++matchesFound;
				try {
					end = start + input.length();
					section.getHighlighter().addHighlight(start, end, painter);
					start = content.indexOf(input, end);

				} catch (BadLocationException e) {
					JOptionPane.showMessageDialog(null,
							"Error: " + e.getMessage());
				}
			} else {
				isSearching = false;
				if (matchesFound == 0) {
					isFalse++;
				}
			}
		}
	}