List of usage examples for javax.swing.text.html StyleSheet importStyleSheet
public void importStyleSheet(URL url)
url. From source file:com.vladsch.idea.multimarkdown.editor.MultiMarkdownPreviewEditor.java
public static void setStyleSheet(JEditorPane jEditorPane) { HTMLEditorKit htmlKit = new HTMLEditorKit(); final StyleSheet style = new StyleSheet(); if (!MultiMarkdownGlobalSettings.getInstance().useCustomCss(false)) { style.importStyleSheet(MultiMarkdownGlobalSettings.getInstance().getCssFileURL(false)); } else {/*w ww .ja v a2 s . c o m*/ try { style.loadRules(new StringReader(MultiMarkdownGlobalSettings.getInstance().getCssText(false)), null); } catch (IOException e) { e.printStackTrace(); } } htmlKit.setStyleSheet(style); jEditorPane.setEditorKit(htmlKit); }
From source file:com.vladsch.idea.multimarkdown.editor.MultiMarkdownPreviewEditor.java
protected void setStyleSheet() { if (isRawHtml) return;//www . j a va 2 s . c o m MultiMarkdownEditorKit htmlKit = new MultiMarkdownEditorKit(); final StyleSheet style = new MultiMarkdownStyleSheet(); if (!MultiMarkdownGlobalSettings.getInstance().useCustomCss(false)) { style.importStyleSheet(MultiMarkdownGlobalSettings.getInstance().getCssFileURL(false)); } else { try { style.loadRules(new StringReader(MultiMarkdownGlobalSettings.getInstance().getCssText(false)), null); } catch (IOException e) { e.printStackTrace(); } } htmlKit.setStyleSheet(style); jEditorPane.setEditorKit(htmlKit); }