Class FlatComboBoxUI.CellPaddingBorder

java.lang.Object
javax.swing.border.AbstractBorder
com.formdev.flatlaf.ui.FlatComboBoxUI.CellPaddingBorder
All Implemented Interfaces:
Serializable, Border
Enclosing class:
FlatComboBoxUI

private static class FlatComboBoxUI.CellPaddingBorder extends AbstractBorder
Cell padding border used in popup list and for current value if not editable.

The insets are the union of the cell padding and the renderer border insets, which vertically aligns text in popup list with text in combobox.

The renderer border is painted on the outer side of this border.

For button style "mac", also used to increase insets on left side for "checked item" icon and to paint "checked item" icon for selected combobox item.

  • Field Details

  • Constructor Details

    • CellPaddingBorder

      CellPaddingBorder(Insets padding)
  • Method Details

    • install

      void install(Component c, int focusWidth)
    • uninstall

      void uninstall()
      Uninstall border from previously installed component. Because this border is installed in PopupListCellRenderer.getListCellRendererComponent(), there is no single place to uninstall it. This is the reason why this method is called from various places.
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      Overrides:
      getBorderInsets in class AbstractBorder
    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class AbstractBorder