Terai Atsuhiro 2021-05-21 (金) 03:22:02

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

JLabel label = new JLabel(image);
label.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
label.setBorder(null);
label.setBounds(1,1,image.getIconWidth(),image.getIconHeight());
Insets m  = field01.getMargin();
Insets m2 = new Insets(m.top,m.left+image.getIconWidth(),m.bottom,m.right);
field01.setMargin(m2);
field01.add(label);

Swing/IconComboBox

JTextField field = (JTextField) combo02.getEditor().getEditorComponent();