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

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

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

JTextArea.setHighlighter介绍

暂无

代码示例

代码示例来源:origin: ATLauncher/ATLauncher

public NilCard(String message) {
  super(new BorderLayout());
  RelocalizationManager.addListener(this);
  if (Utils.isMac()) {
    this.setBorder(new TitledBorder(null, Language.INSTANCE.localize("common.nothingtoshow"), TitledBorder
        .DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("SansSerif", Font.BOLD, 14)));
  } else {
    this.setBorder(new TitledBorder(null, Language.INSTANCE.localize("common.nothingtoshow"), TitledBorder
        .DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("SansSerif", Font.BOLD, 15)));
  }
  this.error.setBorder(BorderFactory.createEmptyBorder());
  this.error.setEditable(false);
  this.error.setHighlighter(null);
  this.error.setLineWrap(true);
  this.error.setWrapStyleWord(true);
  this.error.setText(message);
  this.splitter.setEnabled(false);
  this.splitter.setLeftComponent(new ImagePanel(defaultImage));
  this.splitter.setRightComponent(this.error);
  this.add(this.splitter, BorderLayout.CENTER);
}

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

public void setupGui () {
    setIconImage(Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/image/logo_ftb.png")));
    setTitle("Could not log in");
    setResizable(true);

    Container panel = getContentPane();
    panel.setLayout(new MigLayout());

    text = new JTextArea(I18N.getLocaleString("PLAYOFFLINE_WANNA"));
    text.setEditable(false);
    text.setHighlighter(null);
    text.setBorder(BorderFactory.createEmptyBorder());
    play = new JButton(I18N.getLocaleString("MAIN_YES"));
    abort = new JButton(I18N.getLocaleString("MAIN_NO"));

    panel.add(text, GuiConstants.WRAP);
    panel.add(abort, GuiConstants.FILL_TWO);
    panel.add(play, GuiConstants.GROW);

    pack();
    setLocationRelativeTo(getOwner());
  }
}

代码示例来源:origin: ATLauncher/ATLauncher

this.descArea.setBorder(BorderFactory.createEmptyBorder());
this.descArea.setEditable(false);
this.descArea.setHighlighter(null);
this.descArea.setLineWrap(true);
this.descArea.setWrapStyleWord(true);

代码示例来源:origin: ATLauncher/ATLauncher

this.descArea.setLineWrap(true);
this.descArea.setEditable(false);
this.descArea.setHighlighter(null);
this.descArea.setWrapStyleWord(true);

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

versionLbl.setHighlighter(null);
versionLbl.setBorder(BorderFactory.createEmptyBorder());

代码示例来源:origin: sarahtattersall/PIPE

/**
 * Initialize with an (x,y) location
 * @param x coordinate
 * @param y coordinate 
 */
private void initialize(int x, int y) {
  originalX = x;
  originalY = y;
  noteText.setAlignmentX(Component.CENTER_ALIGNMENT);
  noteText.setAlignmentY(Component.CENTER_ALIGNMENT);
  noteText.setOpaque(false);
  noteText.setEditable(false);
  noteText.setEnabled(false);
  noteText.setLineWrap(true);
  noteText.setWrapStyleWord(true);
  // Set minimum size the preferred size for an empty string:
  noteText.setText("");
  noteText.setFont(
      new Font(GUIConstants.ANNOTATION_DEFAULT_FONT, Font.PLAIN, GUIConstants.ANNOTATION_DEFAULT_FONT_SIZE));
  noteText.setSize(noteText.getPreferredSize().width, noteText.getPreferredSize().height);
  noteText.setMinimumSize(noteText.getPreferredSize());
  noteText.setHighlighter(new DefaultHighlighter());
  noteText.setDisabledTextColor(GUIConstants.NOTE_DISABLED_COLOUR);
  noteText.setForeground(GUIConstants.NOTE_EDITING_COLOUR);
  add(noteText);
  setLocation(x - GUIConstants.RESERVED_BORDER / 2, y - GUIConstants.RESERVED_BORDER / 2);
}

相关文章

JTextArea类方法