Reputation: 31
I'm able to add background color to my JComboBox
in Swing (Java). How to color individual text values in the combo box when user selects those?
Upvotes: 0
Views: 62
Reputation: 1473
You can implement ListCellRenderer interface or extend DefaultListCellRenderer to customize style of drop-down list items and set it:
jComboBox.setRenderer(new MyListCellRenderer());
Upvotes: 4