set items color in JCombo box

Hi, I would like to custom the items color (background/ foreground) in a combo box. How can I do ? I think I have to write a self render component right? But could some of you give me some examples? Thanks for help.
[236 byte] By [mcstevenjpa] at [2007-11-27 5:40:15]
# 1

JComboBox uses ListCellRenderer, so you can either implement this interface or extend the javax.swing.DefaultListCellRenderer class, second option will be easier.

Also visit http://java.sun.com/developer/technicalArticles/GUI/jlist/index.html I think going thru this will solve your problem.

Swing_guya at 2007-7-12 15:16:30 > top of Java-index,Desktop,Core GUI APIs...
# 2
> But could some of you give me some examples?Sure, search the forum for examples or read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer]How to Use Combo Boxes[/url] for an example.
camickra at 2007-7-12 15:16:30 > top of Java-index,Desktop,Core GUI APIs...