javax.swing.JTextField.setSelectedTextColor()方法的使用及代码示例

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

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

JTextField.setSelectedTextColor介绍

暂无

代码示例

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

this.textField.setBorder(null);
this.textField.setOpaque(false);
this.textField.setSelectedTextColor(Color.WHITE);
this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT);

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

public void setSelectionForeground(Color color) {
  if(renderer != null) {
    renderer.setSelectionForeground(color);
    textField.setSelectedTextColor(color);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-profiler

findWhatField.setSelectedTextColor(UIConstants.TABLE_SELECTION_FOREGROUND_COLOR);
findWhatField.setPreferredSize(new Dimension(260, findWhatField.getPreferredSize().height));
gridBagConstraints = new java.awt.GridBagConstraints();

代码示例来源:origin: atarw/material-ui-swing

private void changeColorOnFocus(boolean hasFocus) {
  JTextField c = (JTextField) getComponent();
  /*c.setSelectionColor(hasFocus ? activeBackground : inactiveBackground);
  c.setForeground(hasFocus ? activeForeground : inactiveForeground);
  c.setSelectedTextColor(hasFocus ? activeForeground : inactiveForeground);*/
  if(hasFocus && (activeBackground != null) && (activeForeground != null)){
    c.setSelectionColor(activeBackground);
    c.setForeground(activeForeground);
    c.setSelectedTextColor(activeForeground);
  }
  if(!hasFocus && (inactiveBackground != null) && (inactiveForeground != null)){
    c.setSelectionColor(inactiveBackground);
    c.setForeground(inactiveForeground);
    c.setSelectedTextColor(inactiveForeground);
  }
  c.paint(c.getGraphics());
}

相关文章

JTextField类方法