javax.swing.JTextPane.setHighlighter()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中javax.swing.JTextPane.setHighlighter()方法的一些代码示例,展示了JTextPane.setHighlighter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.setHighlighter()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:setHighlighter

JTextPane.setHighlighter介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
 public static JTextPane createDescriptionPane() {
  JTextPane result = new JTextPane();
  result.addHyperlinkListener(new BrowserHyperlinkListener());
  result.setContentType("text/html");
  Font descriptionFont = UIUtil.getLabelFont(UIUtil.FontSize.SMALL);
  HTMLEditorKit editorKit = UIUtil.getHTMLEditorKit();
  editorKit.getStyleSheet().addRule("body, p {" +
                   "color:#" + ColorUtil.toHex(UIUtil.getLabelFontColor(UIUtil.FontColor.BRIGHTER)) + ";" +
                   "font-family:" + descriptionFont.getFamily() + ";" +
                   "font-size:" + descriptionFont.getSize() + "pt;}");
  result.setHighlighter(null);
  result.setEditorKit(editorKit);
  return result;
 }
}

代码示例来源:origin: stackoverflow.com

t.setSelectionColor(new Color(1.0f, 1.0f, 1.0f, 0.0f));
Highlighter hilite = new MyHighlighter();
t.setHighlighter(hilite);
t.setText("Line1\nLine2\nLine3\nLine4\nLine5\n");

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

private void outputSearch(JTextPane toSearch, JTextField entry,
    boolean ignoreCase) {
  Highlighter hilit = new DefaultHighlighter();
  toSearch.setHighlighter(hilit);
  Highlighter.HighlightPainter painter = new DefaultHighlighter.DefaultHighlightPainter(
      HILIT_COLOR);

代码示例来源:origin: MinecraftForge/Installer

text.setHighlighter(null);
text.setBackground(label.getBackground());

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

listTextArea.setHighlighter(hilit);

代码示例来源:origin: stackoverflow.com

muTextPane.setHighlighter(new MyHighlighter());
add(muTextPane);
pack();

相关文章

JTextPane类方法