/** * Returns the spinner text border insets under the specified font size. * * @param fontSize * Font size. * @return Spinner text border insets under the specified font size. */ public static Insets getSpinnerTextBorderInsets(int fontSize) { Insets textInsets = getComboTextBorderInsets(fontSize); return new Insets(textInsets.top - 1, textInsets.left, textInsets.bottom - 1, textInsets.right); }
/** * Returns the spinner text border insets under the specified font size. * * @param fontSize * Font size. * @return Spinner text border insets under the specified font size. */ public static Insets getSpinnerTextBorderInsets(int fontSize) { Insets textInsets = getComboTextBorderInsets(fontSize); return new Insets(textInsets.top - 1, textInsets.left, textInsets.bottom - 1, textInsets.right); }
@Override protected void configureEditor() { super.configureEditor(); // This for Mustang - setting Substance once again adds a border on // the text field in the combo editor. if (this.editor instanceof JComponent) { Insets ins = SubstanceSizeUtils .getComboTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.editor)); ((JComponent) this.editor).setBorder(new EmptyBorder(ins.top, ins.left, ins.bottom, ins.right)); this.editor.setBackground(this.comboBox.getBackground()); // ((JComponent) this.editor).setBorder(new LineBorder(Color.red)); } }
@Override protected void configureEditor() { super.configureEditor(); // This for Mustang - setting Substance once again adds a border on // the text field in the combo editor. if (this.editor instanceof JComponent) { Insets ins = SubstanceSizeUtils .getComboTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(this.editor)); ((JComponent) this.editor).setBorder(new EmptyBorder(ins.top, ins.left, ins.bottom, ins.right)); this.editor.setBackground(this.comboBox.getBackground()); // ((JComponent) this.editor).setBorder(new LineBorder(Color.red)); } }
@Override protected JFormattedTextField createEditor() { JFormattedTextField result = super.createEditor(); Insets ins = SubstanceSizeUtils .getComboTextBorderInsets(SubstanceSizeUtils .getComponentFontSize(result)); result.setBorder(new EmptyBorder(ins.top, ins.left, ins.bottom, ins.right)); result.setBackground(this.datePicker.getBackground()); result.setOpaque(false); return result; }