@Override
	public void actionPerformed(ActionEvent e) {
		boolean selection = false;
		
		DocUtils.buttonDoClick(e);
		wordProcessor.area1.requestFocus();
		String text = wordProcessor.area1.getSelectedText();
		int start = 0, length = 0;
		if (text != null) {
			selection = true;
			start = wordProcessor.area1.getSelectionStart();
			length = text.length();
		}
		
		if (wordProcessor.italic.isSelected()) {
			try {
				if (selection) {
					wordProcessor.doc.remove(start, length);
					wordProcessor.doc.insertString(start, text, wordProcessor.doc.getStyle("italic"));
				}
			}
			catch (BadLocationException ble) {
				ble.printStackTrace();
			}
		}
		else {
			try {
				if (selection) {
					wordProcessor.doc.remove(start, length);
					wordProcessor.doc.insertString(start, text, wordProcessor.doc.getStyle("regular"));
				}
			}
			catch (BadLocationException ble) {
				ble.printStackTrace();
			}
		}
	}