JComboBox is a composite JComponent and contains JButton with Icon , you can remove it with setIcon (null) or replace it with another icon
for example (how to do this with simple steps, NOTICE is only valid for Metal Look and Feel
)
JComboBox coloredArrowsCombo = myComboBox; BufferedImage coloredArrowsImage = null; try { coloredArrowsImage = ImageIO.read(AppVariables.class.getResource("resources/passed.png")); } catch (IOException ex) { Logger.getLogger(someClessName.class.getName()).log(Level.SEVERE, null, ex); } if (!(coloredArrowsImage == null)) { Icon coloredArrowsIcon = new ImageIcon(coloredArrowsImage); Component[] comp = coloredArrowsCombo.getComponents(); for (int i = 0; i < comp.length; i++) { if (comp[i] instanceof MetalComboBoxButton) { MetalComboBoxButton coloredArrowsButton = (MetalComboBoxButton) comp[i]; coloredArrowsButton.setComboIcon(coloredArrowsIcon); break; } } }
EDIT: for better output, you can place coloredArrowsButton.setRolloverIcon(someIcon);
source share