本文整理了Java中javax.swing.JTextField.setBackground()
方法的一些代码示例,展示了JTextField.setBackground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.setBackground()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:setBackground
暂无
代码示例来源: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: stanfordnlp/CoreNLP
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
JTextField l = ((TreeFromFile) value).getLabel();
l.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
l.setOpaque(true);
if(cellHasFocus || isSelected) {
l.setBackground(highlightColor);
} else {
l.setBackground(Color.WHITE);
}
return l;
}
代码示例来源:origin: zzz40500/GsonFormat
private void initGeneratePanel(PsiFile file) {
generateClassTF.setBackground(errorLB.getBackground());
currentClass = ((PsiJavaFileImpl) file).getPackageName() + "." + file.getName().split("\\.")[0];
generateClassLB.setText(currentClass);
代码示例来源:origin: skylot/jadx
rTextArea.setCaretPosition(forward ? 0 : rTextArea.getDocument().getLength() - 1);
search(direction);
searchField.setBackground(COLOR_BG_WARN);
return;
searchField.setBackground(COLOR_BG_ERROR);
} else {
searchField.setBackground(COLOR_BG_NORMAL);
代码示例来源:origin: wildfly/wildfly
txtField.setBackground(Color.white);
input.add(txtField);
代码示例来源:origin: runelite/runelite
setBackground(ColorScheme.DARK_GRAY_COLOR);
input.setBackground(ColorScheme.DARKER_GRAY_COLOR);
input.setPreferredSize(new Dimension(35, 30));
input.setBorder(new EmptyBorder(5, 5, 5, 5));
代码示例来源:origin: stanfordnlp/CoreNLP
/**
* Adds the given tree to the display without removing already
* displayed trees
* @param match tree to be added
*/
private void addMatch(TreeFromFile match, List<Tree> matchedParts) {
JPanel treeDisplay = new JPanel(new BorderLayout());
JTextField filename = new JTextField("From file: " + match.getFilename());
filename.setEditable(false);
MouseInputAdapter listener = new FilenameMouseInputAdapter(filename);
filename.addMouseListener(listener);
filename.addMouseMotionListener(listener);
treeDisplay.add(filename, BorderLayout.NORTH);
if(TregexGUI.getInstance().isTdiffEnabled()) {
tjp = getTreeJPanel(match.getDiffDecoratedTree(), matchedParts);
tjp.setDiffConstituents(match.getDiffConstituents());
} else {
tjp = getTreeJPanel(match.getTree(), matchedParts);
}
matchedPartCoordinates = tjp.getMatchedPartCoordinates();
matchedPartCoordinateIdx = -1;
treeDisplay.add(tjp, BorderLayout.CENTER);
filename.setOpaque(true);
filename.setBackground(tjp.getBackground());
filename.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
scroller.setViewportView(treeDisplay);
this.revalidate();
this.repaint();
}
代码示例来源:origin: runelite/runelite
hexInput.setBackground(ColorScheme.DARKER_GRAY_COLOR);
代码示例来源:origin: Nilhcem/FakeSMTP
saveMsgField.setBackground(bg);
代码示例来源:origin: fossasia/neurolab-desktop
textIP.setBackground(new Color(100, 255, 170));
textOSCPort.setBackground(new Color(100, 255, 170));
textSerialPort.setBackground(new Color(100, 255, 170));
代码示例来源:origin: nodebox/nodebox
hexField.setForeground(Theme.TEXT_NORMAL_COLOR);
hexField.setHorizontalAlignment(JTextField.CENTER);
hexField.setBackground(null);
hexPanel.add(hexField);
hexField.setBounds(0, 10, 110, 22);
代码示例来源:origin: misakuo/svgtoandroid
@Override
public void focusLost(FocusEvent e) {
svgPath.setBackground(JBColor.WHITE);
}
});
代码示例来源:origin: misakuo/svgtoandroid
@Override
public void focusLost(FocusEvent e) {
xmlName.setBackground(JBColor.WHITE);
}
});
代码示例来源:origin: otros-systems/otroslogviewer
@Override
public void insertUpdate(DocumentEvent e) {
textField.setBackground(editingColor);
deleyedSwingInvoke.performAction();
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
protected void toggleSearchField(JTextField textToFindField, boolean matchFound) {
if(!matchFound) {
textToFindField.setBackground(LIGHT_RED);
textToFindField.setForeground(Color.WHITE);
} else {
textToFindField.setBackground(Color.WHITE);
textToFindField.setForeground(Color.BLACK);
}
}
代码示例来源:origin: chatty/chatty
@Override
public void windowClosing(WindowEvent e) {
g.resetSearch(owner);
searchText.setText(null);
searchText.setBackground(COLOR_NORMAL);
}
});
代码示例来源:origin: chatty/chatty
@Override
public void actionPerformed(ActionEvent e) {
if (!g.search(owner, searchText.getText())) {
searchText.setBackground(COLOR_NO_RESULT);
timer.restart();
}
}
};
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
/** Creates new form PackagingAddingFilesProgressPanel */
public PackagingAddingFilesProgressPanel(JButton stopButton) {
this.stopButton = stopButton;
initComponents();
progressBar.setIndeterminate(true);
fileTextField.setBackground(getBackground());
}
代码示例来源:origin: mucommander/mucommander
@Override
public void setBackground(Color color) {
if(renderer == null)
super.setBackground(color);
else {
renderer.setBackground(color);
textField.setBackground(color);
}
}
代码示例来源:origin: stackoverflow.com
JComboBox cb = ...;
...
cb.setEditable(true);
ComboBoxEditor editor = cb.getEditor()
JTextField etf = (JTextField)etf.getEditorComponent()
etf.setDisabledTextColor(UIManager.getColor("ComboBox.foreground"));
etf.setBackground(UIManager.getColor("ComboBox.background"));
// editor.setItem(format(obj));
cb.setEnabled(false);
内容来源于网络,如有侵权,请联系作者删除!