本文整理了Java中javax.swing.JTextArea.setCaretColor()
方法的一些代码示例,展示了JTextArea.setCaretColor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextArea.setCaretColor()
方法的具体详情如下:
包路径:javax.swing.JTextArea
类名称:JTextArea
方法名:setCaretColor
暂无
代码示例来源:origin: stackoverflow.com
static void decorate(JTextArea a, final BufferedImage img) {
a.setUI(new javax.swing.plaf.basic.BasicTextAreaUI() {
@Override
protected void paintBackground(Graphics g) {
g.drawImage(img, 0, 0, null);
}
});
a.setPreferredSize(new Dimension(img.getWidth(), img.getHeight()));
a.setForeground(Color.white);
a.setCaretColor(Color.lightGray);
}
代码示例来源:origin: Jamling/SmartIM
tfError.setEditable(false);
tfError.setBorder(new EmptyBorder(0, 0, 0, 0));
tfError.setCaretColor(Color.RED);
tfError.setForeground(Color.RED);
tfError.setLineWrap(true);
代码示例来源:origin: stackoverflow.com
text.setRows(10);
text.setText("I am a console!");
text.setCaretColor(new java.awt.Color(0, 255, 0));
Document doc = new PlainDocument();
doc.addDocumentListener(docListener);
代码示例来源:origin: kasonyang/kalang
codeArea.setCaretColor(new java.awt.Color(255, 255, 255));
codeArea.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
codeArea.setMargin(new java.awt.Insets(5, 5, 5, 5));
代码示例来源:origin: mucommander/mucommander
/**
* Creates the dialog's shell output area.
* @return a scroll pane containing the dialog's shell output area.
*/
private JScrollPane createOutputArea() {
// Creates and initialises the output area.
outputTextArea = new JTextArea();
outputTextArea.setLineWrap(true);
outputTextArea.setCaretPosition(0);
outputTextArea.setRows(10);
outputTextArea.setEditable(false);
outputTextArea.addKeyListener(this);
// Applies the current theme to the shell output area.
outputTextArea.setForeground(ThemeManager.getCurrentColor(Theme.SHELL_FOREGROUND_COLOR));
outputTextArea.setCaretColor(ThemeManager.getCurrentColor(Theme.SHELL_FOREGROUND_COLOR));
outputTextArea.setBackground(ThemeManager.getCurrentColor(Theme.SHELL_BACKGROUND_COLOR));
outputTextArea.setSelectedTextColor(ThemeManager.getCurrentColor(Theme.SHELL_SELECTED_FOREGROUND_COLOR));
outputTextArea.setSelectionColor(ThemeManager.getCurrentColor(Theme.SHELL_SELECTED_BACKGROUND_COLOR));
outputTextArea.setFont(ThemeManager.getCurrentFont(Theme.SHELL_FONT));
// Creates a scroll pane on the shell output area.
return new JScrollPane(outputTextArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
代码示例来源:origin: mucommander/mucommander
private void setForegroundColors() {
preview.setForeground(themeData.getColor(ThemeData.EDITOR_FOREGROUND_COLOR));
preview.setCaretColor(themeData.getColor(ThemeData.EDITOR_FOREGROUND_COLOR));
preview.setSelectedTextColor(themeData.getColor(ThemeData.EDITOR_SELECTED_FOREGROUND_COLOR));
}
代码示例来源:origin: Exslims/MercuryTrade
JTextArea words = componentsFactory.getSimpleTextArea(this.scannerService.get().getWords());
words.setEditable(true);
words.setCaretColor(AppThemeColor.TEXT_DEFAULT);
words.setBorder(BorderFactory.createLineBorder(AppThemeColor.HEADER));
words.setBackground(AppThemeColor.SLIDE_BG);
代码示例来源:origin: mucommander/mucommander
textArea.setCaretColor(ThemeManager.getCurrentColor(Theme.EDITOR_FOREGROUND_COLOR));
textArea.setBackground(ThemeManager.getCurrentColor(Theme.EDITOR_BACKGROUND_COLOR));
textArea.setSelectedTextColor(ThemeManager.getCurrentColor(Theme.EDITOR_SELECTED_FOREGROUND_COLOR));
代码示例来源:origin: org.integratedmodelling/klab-common
inputArea.setBackground(defaultBackground);
inputArea.setForeground(defaultForeground);
inputArea.setCaretColor(defaultCaret);
inputArea.setWrapStyleWord(true);
inputArea.setLineWrap(true);
代码示例来源:origin: bbuck/DragonConsole
inputArea.setBackground(defaultBackground);
inputArea.setForeground(defaultForeground);
inputArea.setCaretColor(defaultCaret);
inputArea.setWrapStyleWord(true);
inputArea.setLineWrap(true);
代码示例来源:origin: mucommander/mucommander
private void setForegroundColors() {
shellPreview.setForeground(themeData.getColor(ThemeData.SHELL_FOREGROUND_COLOR));
shellPreview.setSelectedTextColor(themeData.getColor(ThemeData.SHELL_SELECTED_FOREGROUND_COLOR));
shellPreview.setCaretColor(themeData.getColor(ThemeData.SHELL_FOREGROUND_COLOR));
historyPreview.setForeground(themeData.getColor(ThemeData.SHELL_HISTORY_FOREGROUND_COLOR));
historyPreview.setSelectionForeground(themeData.getColor(ThemeData.SHELL_HISTORY_SELECTED_FOREGROUND_COLOR));
}
代码示例来源:origin: org.integratedmodelling/klab-common
/**
* Sets the default styles so the console colors mimic that of a standard Gray on
* Black color setting. Sets the default colors for defaultColor, systemColor, and
* errorColor.
*/
public void setDefaultStyle() {
consolePane.setBackground(defaultBackground);
consolePane.setCaretColor(defaultCaret);
consolePane.setForeground(defaultForeground);
inputArea.setBackground(defaultBackground);
inputArea.setCaretColor(defaultCaret);
inputArea.setForeground(defaultForeground);
consolePrompt.setPromptForeground(defaultForeground);
consolePrompt.setBackground(defaultBackground);
defaultColor = "xb";
systemColor = "cb";
errorColor = "rb";
inputColor = "xb";
setInputAttribute();
if (!useInlineInput)
consolePrompt.setDefaultColor(defaultColor);
clearConsole();
printDefault();
}
代码示例来源:origin: org.integratedmodelling/klab-common
/**
* Set the background to White and the foreground text to Black to mimic the default
* color settings of a Mac Terminal. Also changes the defaultColor, systemColor, and
* errorColor codes so that they take into account the new background/foreground
* colors.
*/
public void setMacStyle() {
consolePane.setBackground(defaultMacBackground);
consolePane.setCaretColor(defaultMacCaret);
consolePane.setForeground(defaultMacForeground);
inputArea.setBackground(defaultMacBackground);
inputArea.setCaretColor(defaultMacCaret);
inputArea.setForeground(defaultMacForeground);
consolePrompt.setPromptForeground(defaultMacForeground);
consolePrompt.setBackground(defaultMacBackground);
defaultColor = "bw";
systemColor = "ow";
errorColor = "rw";
inputColor = "bw";
setInputAttribute();
if (!useInlineInput)
consolePrompt.setDefaultColor(defaultColor);
clearConsole();
printDefault();
}
代码示例来源:origin: bbuck/DragonConsole
/**
* Sets the default styles so the console colors mimic that of a standard
* Gray on Black color setting. Sets the default colors for defaultColor,
* systemColor, and errorColor.
*/
public void setDefaultStyle() {
consolePane.setBackground(defaultBackground);
consolePane.setCaretColor(defaultCaret);
consolePane.setForeground(defaultForeground);
inputArea.setBackground(defaultBackground);
inputArea.setCaretColor(defaultCaret);
inputArea.setForeground(defaultForeground);
consolePrompt.setPromptForeground(defaultForeground);
consolePrompt.setBackground(defaultBackground);
defaultColor = "xb";
systemColor = "cb";
errorColor = "rb";
inputColor = "xb";
setInputAttribute();
if (!useInlineInput)
consolePrompt.setDefaultColor(defaultColor);
clearConsole();
printDefault();
}
代码示例来源:origin: bbuck/DragonConsole
/**
* Set the background to White and the foreground text to Black to mimic
* the default color settings of a Mac Terminal.
* Also changes the defaultColor, systemColor, and errorColor codes so
* that they take into account the new background/foreground colors.
*/
public void setMacStyle() {
consolePane.setBackground(defaultMacBackground);
consolePane.setCaretColor(defaultMacCaret);
consolePane.setForeground(defaultMacForeground);
inputArea.setBackground(defaultMacBackground);
inputArea.setCaretColor(defaultMacCaret);
inputArea.setForeground(defaultMacForeground);
consolePrompt.setPromptForeground(defaultMacForeground);
consolePrompt.setBackground(defaultMacBackground);
defaultColor = "bw";
systemColor = "ow";
errorColor = "rw";
inputColor = "bw";
setInputAttribute();
if (!useInlineInput)
consolePrompt.setDefaultColor(defaultColor);
clearConsole();
printDefault();
}
代码示例来源:origin: mikaelhg/openblocks
textArea.setForeground(Color.BLACK);
textArea.setBackground(background);
textArea.setCaretColor(Color.BLACK);
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true);
内容来源于网络,如有侵权,请联系作者删除!