public void changeStyle(JTextPane section, String style) {
		int start = 0;
		int end = section.getText().length();

		if (!section.getSelectedText().isEmpty()) {
			start = section.getSelectionStart();
			end = section.getSelectedText().length();
		}

		switch (style) {
		case "B":
			bold = (StyleConstants.isBold(attributes)) ? false : true;
			StyleConstants.setBold(attributes, bold);
			break;
		case "I":
			italic = (StyleConstants.isItalic(attributes)) ? false : true;
			StyleConstants.setItalic(attributes, italic);
			break;
		case "U":
			underline = (StyleConstants.isUnderline(attributes)) ? false : true;
			StyleConstants.setUnderline(attributes, underline);
			break;
		default: // Do nothing, never invoked
		}
		// Sets style in the view
		section.getStyledDocument().setCharacterAttributes(start, end,
				attributes, false);
	}