public void caretUpdate(CaretEvent e) {
		
		boolean boldFound = false;
		boolean italicFound = false;
		boolean underlineFound = false;
		
		int dot = e.getDot();
		int mark = e.getMark();
		
		if (dot == mark) {
			wordProcessor.copy.setEnabled(false);
			wordProcessor.cut.setEnabled(false);
			
			boldFound = checkStyleAtIndex(StyleConstants.Bold, dot - 1, wordProcessor.lockButtonBold);
			italicFound = checkStyleAtIndex(StyleConstants.Italic, dot - 1, wordProcessor.lockButtonItalic);
			underlineFound = checkStyleAtIndex(StyleConstants.Underline, dot - 1, wordProcessor.lockButtonUnderline);
		}
		else {
			wordProcessor.copy.setEnabled(true);
			wordProcessor.cut.setEnabled(true);
			
			for (int i = Math.min(dot, mark); i < Math.max(dot, mark); i++) {
				boldFound = checkStyleAtIndex(StyleConstants.Bold, i);
				italicFound = checkStyleAtIndex(StyleConstants.Italic, i);
				underlineFound = checkStyleAtIndex(StyleConstants.Underline, i);
				
				if (boldFound || italicFound || underlineFound) {
					break;
				}
			}
		}
		
		selectButton(wordProcessor.bold, boldFound);
		selectButton(wordProcessor.italic, italicFound);
		selectButton(wordProcessor.underline, underlineFound);
		
	}