JDK-6367601 : Windows/Motif L&F: Changing the JComboBox background does not change the popup of the JCombobox
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2005-12-28
  • Updated: 2019-12-17
  • Resolved: 2019-12-17
Description
Aim of the program :- to change the background color of the JComboBox
	 
 Step to reproduce
 1) start the program. 
 2) Select Look And Feel Menu  & select Motif Look and Feel MenuIem .
 3) Select Color Menu & select Background Color Menuitem. You can see background color of     JComboBox is changed (the value & down arrow button).
 4) Click on the JComboBox , the  popupMenu of JComboBox color is not changed. 
      Expect result :- The whole JComboBox is supposed to Change including the popupMenu.
 5) Click on look & feel  Menu & Java look & feel menuitem  , you can see the color is changed for the whole JComboBox including  the popupMenu.
 6) Once again Click on Look And Feel Menu  & select Motif Look and Feel MenuIem. Now the 
    whole JComboBox including  the popupMenu is changed to the specified background color.
	    
   I have attached the sample program.
	 
  I tested this program with build 64 in mustang & in tiger rc build 63 it results same.

Comments
EVALUATION I also wrote a quick test and found the following: setBackground() on a JComboBox doesn't affect the background of the popup under Windows or Motif L&F. However, if you switch the L&F and come back (OR even just call updateComponentTreeUI), then the color is shown in the popup.
14-11-2006

EVALUATION I didn't find the sample program, but I wrote test program myself and checked begavior. The behavior is described right in the description. In the documentation for the JComponent.setBackground() is written: "It is up to the look and feel to honor this propery, some may choose to ignore it." but in Motif LAF the background of combobox is changed and the background of combobox popup is not (it is changed after changing LAF from Motif and after that back to Motif). So, I think this is a bug.
23-01-2006