本文整理了Java中javax.swing.text.html.HTMLEditorKit.getContentType()
方法的一些代码示例,展示了HTMLEditorKit.getContentType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HTMLEditorKit.getContentType()
方法的具体详情如下:
包路径:javax.swing.text.html.HTMLEditorKit
类名称:HTMLEditorKit
方法名:getContentType
暂无
代码示例来源:origin: protegeproject/protege
/**
* Creates a JEditorPane suitable for showing HTML content
* @param hyperlinkListener an optional hyperlink listener
*/
public static JEditorPane createHTMLPane(HyperlinkListener hyperlinkListener) {
JEditorPane editorPane = new JEditorPane(new HTMLEditorKit().getContentType(), "");
// set the font to the same as a normal label
Font font = UIManager.getFont("Label.font");
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }";
((HTMLDocument) editorPane.getDocument()).getStyleSheet().addRule(bodyRule);
editorPane.setEditable(false);
editorPane.setOpaque(false);
if (hyperlinkListener != null){
editorPane.addHyperlinkListener(hyperlinkListener);
}
return editorPane;
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
/**
* Creates a JEditorPane suitable for showing HTML content
* @param hyperlinkListener an optional hyperlink listener
*/
public static JEditorPane createHTMLPane(HyperlinkListener hyperlinkListener) {
JEditorPane editorPane = new JEditorPane(new HTMLEditorKit().getContentType(), "");
// set the font to the same as a normal label
Font font = UIManager.getFont("Label.font");
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }";
((HTMLDocument) editorPane.getDocument()).getStyleSheet().addRule(bodyRule);
editorPane.setEditable(false);
editorPane.setOpaque(false);
if (hyperlinkListener != null){
editorPane.addHyperlinkListener(hyperlinkListener);
}
return editorPane;
}
代码示例来源:origin: org.protege/protege-editor-core-application
/**
* Creates a JEditorPane suitable for showing HTML content
* @param hyperlinkListener an optional hyperlink listener
*/
public static JEditorPane createHTMLPane(HyperlinkListener hyperlinkListener) {
JEditorPane editorPane = new JEditorPane(new HTMLEditorKit().getContentType(), "");
// set the font to the same as a normal label
Font font = UIManager.getFont("Label.font");
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }";
((HTMLDocument) editorPane.getDocument()).getStyleSheet().addRule(bodyRule);
editorPane.setEditable(false);
editorPane.setOpaque(false);
if (hyperlinkListener != null){
editorPane.addHyperlinkListener(hyperlinkListener);
}
return editorPane;
}
内容来源于网络,如有侵权,请联系作者删除!