Hi,
I have a JComboBox which has a list of
string items.I have a requirement,wherein on changing the default selected item of the ComboBox to some other item ...the new selected item should be colored red on the foreground and yellow on the background.
am using a renderer ,extends DefaultListCellRenderer,which runs whenever a new item is selected ,to paint the foreground and background with respective colors.it works fine
the code of my renderer is as follows:
the problem occurs whenever i click on some other control on the screen,the applied coloring just disappears and default coloring appears.But if i click on the same combo box again the apllied coloring reappears.
any suggestion/solution for it?...i want the coloring to stay even if i click anywhere else on the screen.
Regards
Surajeet