Terai Atsuhiro 2021-06-08 (火) 11:23:34

http://terai.xrea.jp/swing/iconcombobox/screenshot.png

private static Border makeIconBorder(JComponent c, ImageIcon i) {
  Border b1 = BorderFactory.createMatteBorder(
                0, i.getIconWidth(), 0, 0, i);
  Border b2 = BorderFactory.createEmptyBorder(0,5,0,0);
  Border b3 = BorderFactory.createCompoundBorder(b1, b2);
  return BorderFactory.createCompoundBorder(c.getBorder(), b3);
}