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

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

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

JEditorPane.setHighlighter介绍

暂无

代码示例

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

@Override
public void setHighlighter( Highlighter h )
{
 super.setHighlighter( new GosuHighlighter( (LayeredHighlighter)h ) );
}

代码示例来源:origin: org.gosu-lang.gosu/gosu-editor

@Override
public void setHighlighter( Highlighter h )
{
 super.setHighlighter( new GosuHighlighter( (LayeredHighlighter)h ) );
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_components

public JEditorPaneSearchProvider(JEditorPane results) {
  this.results = results;
  
  // prepare highlighter to show text find with search command
  selection = new DefaultHighlighter();
  painter = new DefaultHighlighter.DefaultHighlightPainter(HIGHLIGHT_COLOR);
  results.setHighlighter(selection);
}

代码示例来源:origin: Slowpoke101/FTBLaunch

private void setupGui () {
  setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/image/logo_ftb.png")));
  setTitle(I18N.getLocaleString("PRIVATEPACK_TITLE"));
  setResizable(true);
  setPreferredSize(new Dimension(300, 200));
  Container panel = getContentPane();
  panel.setLayout(new MigLayout());
  editorPane = new JEditorPane();
  modpackName = new JTextField(16);
  remove = new JButton(I18N.getLocaleString("MAIN_REMOVE"));
  add = new JButton(I18N.getLocaleString("MAIN_ADD"));
  cancel = new JButton(I18N.getLocaleString("MAIN_CANCEL"));
  modpackName.setColumns(10);
  editorPane.setEditable(false);
  editorPane.setHighlighter(null);
  editorPane.setContentType("text/html");
  editorPane.setText(I18N.getLocaleString("PRIVATEPACK_TEXT"));
  panel.add(editorPane, GuiConstants.FILL_SINGLE_LINE);
  panel.add(modpackName, GuiConstants.FILL_SINGLE_LINE);
  panel.add(add, GuiConstants.FILL_THREE);
  panel.add(remove, GuiConstants.GROW);
  panel.add(cancel, GuiConstants.GROW);
  pack();
  modpackName.requestFocusInWindow();
  setLocationRelativeTo(getOwner());
}

相关文章

JEditorPane类方法