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

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

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

JTextField.setCaretColor介绍

暂无

代码示例

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

private void uiStyle() {
  nameText.setCaretColor(Color.WHITE);
  packageText.setCaretColor(Color.WHITE);
  gameClassText.setCaretColor(Color.WHITE);
  destinationText.setCaretColor(Color.WHITE);
  sdkLocationText.setCaretColor(Color.WHITE);
  nameLabel.setForeground(Color.WHITE);
  packageLabel.setForeground(Color.WHITE);
  gameClassLabel.setForeground(Color.WHITE);
  destinationLabel.setForeground(Color.WHITE);
  sdkLocationLabel.setForeground(Color.WHITE);
  sdkLocationText.setDisabledTextColor(Color.GRAY);
  projectsLabel.setForeground(new Color(255, 20, 20));
  extensionsLabel.setForeground(new Color(255, 20, 20));
  subProjectsPanel.setOpaque(true);
  subProjectsPanel.setBackground(new Color(46, 46, 46));
  for (JPanel extensionPanel : extensionsPanels) {
    extensionPanel.setOpaque(true);
    extensionPanel.setBackground(new Color(46, 46, 46));
  }
}

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

private void uiStyle () {
  content.setBackground(new Color(36, 36, 36));
  content.setForeground(new Color(255, 255, 255));
  bottomPanel.setBackground(new Color(36, 36, 36));
  bottomPanel.setForeground(new Color(255, 255, 255));
  buttonPanel.setBackground(new Color(36, 36, 36));
  buttonPanel.setForeground(new Color(255, 255, 255));
  linkText.setForeground(new Color(20, 150, 20));
  contentPane.setBackground(new Color(36, 36, 36));
  Border line = BorderFactory.createLineBorder(new Color(80, 80, 80));
  Border empty = new EmptyBorder(4, 4, 4, 4);
  CompoundBorder border = new CompoundBorder(line, empty);
  mavenTextField.setBorder(border);
  mavenTextField.setCaretColor(new Color(255, 255, 255));
  mavenTextField.setBackground(new Color(46, 46, 46));
  mavenTextField.setForeground(new Color(255, 255, 255));
}

代码示例来源:origin: Var3D/var3dframe

public void setTintColor(Color color){
  textField.setCaretColor(getColor(color));
  textMessage.setCaretColor(textField.getCaretColor());
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * @see java.awt.Component#setForeground(java.awt.Color)
 */
public void setForeground(Color fg) {
  super.setForeground(fg);
  if ( m_queryF  != null ) {
    m_queryF.setForeground(fg);
    m_queryF.setCaretColor(fg);
  }
  if ( m_resultL != null ) m_resultL.setForeground(fg);
  if ( m_searchL != null ) m_searchL.setForeground(fg);
  if ( m_sbox != null && m_showBorder )
    m_sbox.setBorder(BorderFactory.createLineBorder(fg));
}

代码示例来源:origin: Exslims/MercuryTrade

public JTextField getTextField(String text, FontStyle style, float fontSize) {
  JTextField textField = new JTextField(text);
  if (style != null) {
    textField.setFont(getSelectedFont(style).deriveFont(scale * fontSize));
  }
  textField.setForeground(AppThemeColor.TEXT_DEFAULT);
  textField.setCaretColor(AppThemeColor.TEXT_DEFAULT);
  textField.setBorder(BorderFactory.createCompoundBorder(
      BorderFactory.createLineBorder(AppThemeColor.BORDER, 1),
      BorderFactory.createLineBorder(AppThemeColor.TRANSPARENT, 3)
  ));
  textField.setBackground(AppThemeColor.HEADER);
  return textField;
}

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

output.setForeground(Color.WHITE);
input.setBackground(Color.BLACK);
input.setCaretColor(Color.WHITE);
output.setBackground(Color.BLACK);
output.setEditable(false);

代码示例来源:origin: superzanti/ServerSync

TF_ipAddress.setCaretColor(Color.WHITE);
TF_ipAddress.setHorizontalAlignment(SwingConstants.CENTER);
TF_ipAddress.setForeground(new Color(50, 205, 50));
TF_ipAddress.setBackground(new Color(30, 30, 30));
TF_ipAddress.setPreferredSize(sDetailsElements);
TF_port.setCaretColor(Color.WHITE);
TF_port.setHorizontalAlignment(SwingConstants.CENTER);
TF_port.setForeground(new Color(50, 205, 50));

代码示例来源:origin: nccgroup/AutoRepeater

tabName.setBackground(new Color(0, 0, 0, 0));
tabName.setEditable(false);
tabName.setCaretColor(Color.BLACK);

相关文章

JTextField类方法