String size = Integer.toString(jSlider1.getValue());
String pOpenCode = "[size=" + size + "]";
String pCloseCode = "[/size]";
int s = jTextPane1.getSelectionStart();
int e = jTextPane1.getSelectionEnd();
<BUG>String t = ((DefaultStyledDocument) jTextPane1.getDocument()).getText(s, e - s);
((DefaultStyledDocument) jTextPane1.getDocument()).remove(s, e - s);
((DefaultStyledDocument) jTextPane1.getDocument()).insertString(s, pOpenCode + t + pCloseCode, null);
if (t.length() == 0) {</BUG>
jTextPane1.setCaretPosition(s + pOpenCode.length());

String size = Integer.toString(jSlider1.getValue());
String pOpenCode = "[size=" + size + "]";
String pCloseCode = "[/size]";
int s = jTextPane1.getSelectionStart();
int e = jTextPane1.getSelectionEnd();
String t = jTextPane1.getDocument().getText(s, e - s);
jTextPane1.getDocument().remove(s, e - s);
jTextPane1.getDocument().insertString(s, pOpenCode + t + pCloseCode, null);
if (t.length() == 0) {
jTextPane1.setCaretPosition(s + pOpenCode.length());
