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

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

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

JTextComponent.setCaretColor介绍

暂无

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

editor.setCaretColor(RTextArea.getDefaultCaretColor());

代码示例来源:origin: zgqq/mah

@Override
public void apply(LayoutTheme theme) {
  if (theme instanceof SwingLayoutTheme) {
    SwingLayoutTheme layoutTheme = (SwingLayoutTheme) theme;
    String panelBackgroundColor = layoutTheme.findProperty("background-color");
    panel.setBackground(Color.decode(panelBackgroundColor));
    String inputFieldBackgroundColor = layoutTheme.findProperty("input-field-background-color");
    input.setBackground(Color.decode(inputFieldBackgroundColor));
    String fontColor = layoutTheme.findProperty("input-field-font-color");
    input.setForeground(Color.decode(fontColor));
    String cursorColor = layoutTheme.findProperty("input-cursor-color");
    input.setCaretColor(Color.decode(cursorColor));
  }
}

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

display.setBorder(null);
display.setEditable(false);
display.setCaretColor(Color.BLACK);

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

tarea.setBackground(Color.DARK_GRAY.darker());  
tarea.setForeground(Color.WHITE);
tarea.setCaretColor(Color.WHITE);
tarea.setLineWrap(true);

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

textArea.setBackground(TA_BACKGRND);
textArea.setForeground(TA_FOREGRND);
textArea.setCaretColor(TA_CARET_COLOR);
textArea.setFont(TA_FONT);

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

terminal.setBackground(Color.black);
terminal.setForeground(Color.white);
terminal.setCaretColor(Color.green);
terminal.setDragEnabled(false);
terminal.setCaretPosition(0);

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

txt.setBackground(Color.DARK_GRAY);
txt.setForeground(Color.WHITE);
txt.setCaretColor(Color.WHITE);
txt.setFont(new Font("Serif", Font.PLAIN, 18));
add(new JScrollPane(txt));

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

area.setBackground(Color.black);
area.setForeground(Color.white);
area.setCaretColor(Color.white);
area.addKeyListener(new java.awt.event.KeyAdapter() {
  public void keyPressed(java.awt.event.KeyEvent evt) {

代码示例来源:origin: net.java.abeille/abeille

component.setCaretColor(Color.black); // will be changed by

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

c.setCaretColor(caretColor);
if (debugCaretFocusExtra){
  System.err.println("Updating caret color:"+caretColor);

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

editor.setCaretColor(RTextArea.getDefaultCaretColor());

代码示例来源:origin: org.codehaus.jtstand/jtstand-editor

editor.setCaretColor(RTextArea.getDefaultCaretColor());

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

editor.setCaretColor(RTextArea.getDefaultCaretColor());

代码示例来源:origin: threerings/tripleplay

/** Re-applies the current Field styles to the text component. */
public void validateStyles () {
  Font font = _element.resolveStyle(Style.FONT);
  _textComp.setFont(new java.awt.Font(font.name, awtFontStyle(font.style),
                    FloatMath.round(font.size)));
  Color col = new Color(_element.resolveStyle(Style.COLOR));
  _textComp.setForeground(col);
  _textComp.setCaretColor(col);
  if (isField()) {
    switch (_element.resolveStyle(Style.HALIGN)) {
    case CENTER:
      asField().setHorizontalAlignment(JTextField.CENTER);
      break;
    case LEFT:
      asField().setHorizontalAlignment(JTextField.LEFT);
      break;
    case RIGHT:
      asField().setHorizontalAlignment(JTextField.RIGHT);
      break;
    }
  }
  // TODO: Keyboard.TextType textType = resolveStyle(Field.TEXT_TYPE);
}

代码示例来源:origin: net.java.abeille/abeille

void updateType() {
  JTextComponent c = component;
  if (c != null) {
    Class kitClass = Utilities.getKitClass(c);
    String newType;
    boolean newItalic;
    Color caretColor;
    if (overwriteMode) {
      newType = SettingsUtil.getString(kitClass, SettingsNames.CARET_TYPE_OVERWRITE_MODE, LINE_CARET);
      newItalic = SettingsUtil.getBoolean(kitClass, SettingsNames.CARET_ITALIC_OVERWRITE_MODE, false);
      caretColor = getColor(kitClass, SettingsNames.CARET_COLOR_OVERWRITE_MODE, SettingsDefaults.defaultCaretColorOvwerwriteMode);
    }
    else { // insert mode
      newType = SettingsUtil.getString(kitClass, SettingsNames.CARET_TYPE_INSERT_MODE, LINE_CARET);
      newItalic = SettingsUtil.getBoolean(kitClass, SettingsNames.CARET_ITALIC_INSERT_MODE, false);
      caretColor = getColor(kitClass, SettingsNames.CARET_COLOR_INSERT_MODE, SettingsDefaults.defaultCaretColorInsertMode);
    }
    this.type = newType;
    this.italic = newItalic;
    c.setCaretColor(caretColor);
    dispatchUpdate();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

component.setCaretColor(Color.black); // will be changed by settings later
component.setCaret(caret);

代码示例来源:origin: org.xworker/xworker_core

comp.setCaretColor(caretColor);

代码示例来源:origin: khuxtable/seaglass

c.setCaretColor((Color) style.get(context, prefix + ".caretForeground"));

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

editor.setCaretColor(plaf.getColor(prefix + ".caretForeground"));

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

editor.setCaretColor(plaf.getColor(prefix + ".caretForeground"));

相关文章

JTextComponent类方法