Hi List!

How should I set the colors of my JComboBox instance?

The following sets it for all combo:
<CODE>
    UIManager.put("ComboBox.disabledBackground",  Color.red);
    UIManager.put("ComboBox.disabledForeground",  Color.green);
    UIManager.put("ComboBox.foreground",  Color.magenta);
    UIManager.put("ComboBox.selectionBackground",  Color.gray);
    UIManager.put("ComboBox.selectionForeground",  Color.pink);
</CODE>

So I tought using the next code will do it for me:
(jcbWMTest2 is a JComboBox and I want to alter only this object.)

<CODE>
    jcbWMTest2.putClientProperty("ComboBox.background", Color.cyan);
    jcbWMTest2.putClientProperty("ComboBox.disabledBackground",  Color.red);
    jcbWMTest2.putClientProperty("ComboBox.disabledForeground",
Color.green);
    jcbWMTest2.putClientProperty("ComboBox.foreground",  Color.magenta);
    jcbWMTest2.putClientProperty("ComboBox.selectionBackground",
Color.gray);
    jcbWMTest2.putClientProperty("ComboBox.selectionForeground",
Color.pink);
</CODE>

But it doesn't work! Why? (JAVA SE 1.1.8, Sing 1.1.1)

I know that there is a setBackground/Foreground but it sets the colors in a
too simple way, so the selection, the emply background of the box don't
change from it. Or is it my only solution?

Please help!

Máté

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to