本文整理了Java中javax.swing.JTextField.setBorder()
方法的一些代码示例,展示了JTextField.setBorder()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.setBorder()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:setBorder
暂无
代码示例来源:origin: stanfordnlp/CoreNLP
public JTextField getLabel() {
if(label == null) {
label = new JTextField(this.toString());
label.setBorder(BorderFactory.createEmptyBorder());
}
return label;
}
代码示例来源:origin: stackoverflow.com
JTextField textField = new JTextField();
textField.setBorder(javax.swing.BorderFactory.createEmptyBorder());
代码示例来源: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: deathmarine/Luyten
protected JTextField getSampleTextField() {
if (sampleText == null) {
Border lowered = BorderFactory.createLoweredBevelBorder();
sampleText = new JTextField(("AaBbYyZz"));
sampleText.setHorizontalAlignment(JTextField.CENTER);
sampleText.setBorder(lowered);
sampleText.setPreferredSize(new Dimension(300, 100));
}
return sampleText;
}
代码示例来源:origin: 4thline/cling
public void addLabelAndSelectableLastField(String s, String value, Container parent) {
addLabel(s, parent);
JTextField field = new JTextField(value);
field.setBorder(null);
field.setOpaque(false);
field.setEditable(false);
addLastField(field, parent);
}
}
代码示例来源: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: kiegroup/optaplanner
scoreField.setEditable(false);
scoreField.setForeground(Color.BLACK);
scoreField.setBorder(BorderFactory.createLoweredBevelBorder());
scorePanel.add(scoreField, BorderLayout.CENTER);
refreshScreenDuringSolvingToggleButton = new JToggleButton(refreshScreenDuringSolvingTrueIcon, true);
代码示例来源:origin: runelite/runelite
input.setBorder(new EmptyBorder(5, 5, 5, 5));
((AbstractDocument) input.getDocument()).setDocumentFilter(new DocumentFilter()
代码示例来源: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: 4thline/cling
@Override
public boolean stopCellEditing() {
try {
String text = textField.getText();
/*
if (text == null || text.length() == 0) {
fireEditingStopped();
return true;
}
*/
setArgumentValue(
new ActionArgumentValue(getArgument(), text)
);
fireEditingStopped();
return true;
// TODO
//} catch (ActionException ex) {
} catch (Exception ex) {
setStatus(ex.getMessage());
textField.setBorder(new LineBorder(Color.RED, 1));
return false;
}
}
代码示例来源:origin: runelite/runelite
this.textField.setBorder(null);
this.textField.setOpaque(false);
this.textField.setSelectedTextColor(Color.WHITE);
代码示例来源:origin: runelite/runelite
nameInput.setPreferredSize(new Dimension(0, 24));
nameInput.getTextField().setForeground(Color.WHITE);
nameInput.getTextField().setBorder(new EmptyBorder(0, 8, 0, 0));
代码示例来源:origin: JetBrains/ideavim
myEntry = new JTextField();
myEntry.setBorder(null);
代码示例来源:origin: runelite/runelite
nameInput.setBackground(ColorScheme.DARKER_GRAY_COLOR);
nameInput.setPreferredSize(new Dimension(0, 24));
nameInput.getTextField().setBorder(new EmptyBorder(0, 8, 0, 0));
nameInput.addActionListener(e -> getParent().requestFocusInWindow());
代码示例来源:origin: apache/pdfbox
private void updateText(String statusString)
{
statusField.setText(statusString);
if (!statusField.getBorder().equals(defaultBorder))
{
statusField.setBorder(defaultBorder);
}
}
代码示例来源:origin: ron190/jsql-injection
/**
* Decorate a provided JTextField.
* @param proxy The JTextField to decorate
*/
public JPopupTextField(JTextField proxy) {
super(proxy);
this.getProxy().setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(HelperUi.COLOR_DEFAULT_BACKGROUND, 2),
HelperUi.BORDER_BLU
)
);
}
代码示例来源:origin: ron190/jsql-injection
this.password.setToolTipText(I18n.valueByKey("SQL_SHELL_PASSWORD_TOOLTIP"));
this.username.setBorder(HelperUi.BORDER_BLU);
this.password.setBorder(HelperUi.BORDER_BLU);
代码示例来源:origin: apache/pdfbox
@Override
public void actionPerformed(ActionEvent actionEvent)
{
TreePath path = statusObj.getPathForString(statusField.getText());
if (path != null)
{
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);
tree.requestFocusInWindow();
}
else
{
statusField.setBorder(errorBorder);
}
}
};
代码示例来源:origin: nodebox/nodebox
keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), new HistoryDownAction());
consolePrompt.setKeymap(keymap);
consolePrompt.setBorder(new PromptBorder());
代码示例来源:origin: magefree/mage
title.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
内容来源于网络,如有侵权,请联系作者删除!