Board index » jbuilder » How to color the list under JComboBox?

How to color the list under JComboBox?


2006-01-25 11:57:58 PM
jbuilder10
Hello all:
Is there anyway I could color the text in list under JComboBox?
For example:
JComboBox has three items
Item1
Item2
Item3
I would like to display Item1 as red, item2 as blue and item3 as green.
thank you
-Daniel
 
 

Re:How to color the list under JComboBox?

You should assign custom item renderer that will display list items in
different colors.
Doychin
Daniel Mark wrote:
Quote
Hello all:

Is there anyway I could color the text in list under JComboBox?

For example:
JComboBox has three items

Item1
Item2
Item3

I would like to display Item1 as red, item2 as blue and item3 as green.


thank you
-Daniel