private boolean doFind(boolean doBeep) {
		boolean doWrap = false;
		// Get the text from the document, which will handle the CR/LF
		// better.  If that fails, get the text directly.
		String docText = "";
		try {
			docText = target.getDocument().getText(0, target.getDocument().getLength());
		} catch (BadLocationException e) {
			docText = target.getText();
		}

		String fndText = findTF.getText();

		// Convert the target text and the find text to lower-case if we
		// are doing a case-insensitive operation
		if (! caseCB.isSelected()) {
			docText = docText.toLowerCase();
			fndText = fndText.toLowerCase();
		}

		// Search forward or backwards, depending on the user's selection
		int newPos = 0;
		if (fwdRB.isSelected()) {
			newPos = docText.indexOf(fndText, target.getCaretPosition());
		} else {
			newPos = docText.lastIndexOf(fndText, target.getSelectionStart()-1);
		}

		// If we found the target string, select the matching text; if no
		// match was found, then wrap around to either the top or bottom,
		// depending on whether we are searching FWD or BACK.  If we find
		// the target string, select the matching text.
		//
		// If we have to wrap the search, output an audible "beep" whether
		// the text is found or not.
		if (newPos >= 0) {
			target.getCaret().setSelectionVisible(true);
			target.setCaretPosition(newPos);
			target.moveCaretPosition(newPos + fndText.length());
			statusLabel.setText("Text found ...");
		} else {
			doWrap = true;
			if (fwdRB.isSelected()) {
				newPos = docText.indexOf(fndText);
			} else {
				newPos = docText.lastIndexOf(fndText);			
			}
			if (newPos >= 0) {
				target.getCaret().setSelectionVisible(true);
				target.setCaretPosition(newPos);
				target.moveCaretPosition(newPos + fndText.length());
				statusLabel.setText("Search wrapped ...");
			} else {
				statusLabel.setText("Text not found ...");
			}
			if (doBeep) {
				java.awt.Toolkit.getDefaultToolkit().beep();
			}
		}
		findPosition = newPos;
		enableButtons();
		return doWrap;
	}