package markdowneditor;
import javax.swing.text.DefaultCaret;
import javax.swing.text.html.HTMLEditorKit;
public class MarkdownPane extends javax.swing.JTextPane {
public void Init() {
DefaultCaret caret = (DefaultCaret) getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
HTMLEditorKit kit = new HTMLEditorKit();
setEditorKit(kit);
kit.getStyleSheet().addRule(""
+ "body {\n"
+ " font-family: Helvetica, arial, freesans, clean, sans-serif;\n"
+ " padding: 0px 10px;\n"
+ "}\n"
+ "\n"
+ "h2 {\n"
+ " border-bottom: 1px solid;\n"
+ "}\n"
+ "\n"
+ "code, tt, pre {\n"
+ " border: 1px solid;\n"
+ "}\n"
+ "\n"
+ "pre {\n"
+ " padding: 5px 10px;\n"
+ "}\n"
+ "\n"
+ "blockquote {\n"
+ " font-family: Times;\n"
+ " font-style: italic;\n"
+ " border: 1px solid;\n"
+ " padding: 0px 15px;\n"
+ "}\n"
);
}
}