pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation()); Border border = textField.getBorder(); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField)));
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation()); Border border = textField.getBorder(); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField)));
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation()); Border border = textField.getBorder(); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField)));
pane.setComponentOrientation(JOptionPane.getRootFrame().getComponentOrientation()); Border border = textField.getBorder(); placeholderLabel.setBorder(new EmptyBorder(border.getBorderInsets(textField)));
private void updateText(String statusString) { statusField.setText(statusString); if (!statusField.getBorder().equals(defaultBorder)) { statusField.setBorder(defaultBorder); } }
Border originalBorder; ... JTextField textField = new JTextField(20); originalBorder = textField.getBorder(); // here you can safely change text field's border
public JTextField getJTextField() { if (_jTextField == null) { _jTextField = new JTextField(); _jTextField.setPreferredSize(new Dimension(80, 10)); _jTextField.setBorder(BorderFactory.createCompoundBorder(_jTextField.getBorder(), BorderFactory.createEmptyBorder(0, 2, 0, 0))); } return _jTextField; }
public FixedBasicComboBoxEditor() { // don't change the background color to grey, it would be harder to use :-( //Color c = UIManager.getLookAndFeelDefaults().getColor("ComboBox.background"); //editor.setBackground(new Color(c.getRed(), c.getGreen(), c.getBlue())); // add left padding to the embedded JTextField: // this border-hack was proposed by John B. Matthews on comp.lang.java.gui editor.setBorder(BorderFactory.createCompoundBorder( editor.getBorder(), new EmptyBorder(0, 4, 0, 0))); } }
/** * Wraps and replaces the text fields default border with this object, to * honor the button margins and sizes of the search, clear and popup buttons * and the layout style. */ protected void replaceBorderIfNecessary() { Border original = textField.getBorder(); if (!(original instanceof BuddyLayoutAndBorder)) { borderDelegate = original; textField.setBorder(this); } }
/** * Wraps and replaces the text fields default border with this object, to * honor the button margins and sizes of the search, clear and popup buttons * and the layout style. */ protected void replaceBorderIfNecessary() { Border original = textField.getBorder(); if (!(original instanceof BuddyLayoutAndBorder)) { borderDelegate = original; textField.setBorder(this); } }
/** * Wraps and replaces the text fields default border with this object, to * honor the button margins and sizes of the search, clear and popup buttons * and the layout style. */ protected void replaceBorderIfNecessary() { Border original = textField.getBorder(); if (!(original instanceof BuddyLayoutAndBorder)) { borderDelegate = original; textField.setBorder(this); } }
/** * Wraps and replaces the text fields default border with this object, to * honor the button margins and sizes of the search, clear and popup buttons * and the layout style. */ protected void replaceBorderIfNecessary() { Border original = textField.getBorder(); if (!(original instanceof BuddyLayoutAndBorder)) { borderDelegate = original; textField.setBorder(this); } }
ComboBoxEditor editor = comboBox.getEditor(); JTextField textField = (JTextField)editor.getEditorComponent(); Border outer = textField.getBorder(); Border search = new MatteBorder(0, 16, 0, 0, new ImageIcon("search.gif")); textField.setBorder( new CompoundBorder(outer, search) );
/** * Creates new form MockPVFrame */ public SimpleProbe() { initComponents(); borders.put(AlarmSeverity.NONE, pvTextValue.getBorder()); borders.put(AlarmSeverity.MINOR, new LineBorder(Color.YELLOW)); borders.put(AlarmSeverity.MAJOR, new LineBorder(Color.RED)); borders.put(AlarmSeverity.INVALID, new LineBorder(Color.GRAY)); borders.put(AlarmSeverity.UNDEFINED, new LineBorder(Color.MAGENTA)); } ValueFormat format = new SimpleValueFormat(3);
public void uninstall() { if (textField != null) { textField.removePropertyChangeListener("border", this); if (textField.getBorder() == this) { textField.setBorder(borderDelegate); } textField.setLayout(null); textField = null; } }
public void uninstall() { if (textField != null) { textField.removePropertyChangeListener("border", this); if (textField.getBorder() == this) { textField.setBorder(borderDelegate); } textField.setLayout(null); textField = null; } }
public void uninstall() { if (textField != null) { textField.removePropertyChangeListener("border", this); if (textField.getBorder() == this) { textField.setBorder(borderDelegate); } textField.setLayout(null); textField = null; } }
public void uninstall() { if (textField != null) { textField.removePropertyChangeListener("border", this); if (textField.getBorder() == this) { textField.setBorder(borderDelegate); } textField.setLayout(null); textField = null; } }
/** * Constructor. * @param gui gui * @param combo combo box */ private BaseXEditor(final GUI gui, final BaseXCombo combo) { tf = new BaseXTextField(gui); // adopt border of original editor if(Prop.JAVA8) { final Component comp = combo.getEditor().getEditorComponent(); if(comp instanceof JTextField) tf.setBorder(((JTextField) comp).getBorder()); } }
private void init() { this.setLayout(new BorderLayout()); this.add(getJTextField()); this.add(getJButton(), BorderLayout.EAST); Border textBorder = getJTextField().getBorder(); getJTextField().setBorder(null); this.setBackground(getJTextField().getBackground()); this.setBorder(textBorder); }