JDK-6246498 : Button does not seem to inherit the background color property from the parent frame, win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-03-27
  • Updated: 2011-01-19
  • Resolved: 2007-07-04
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
When no background color is set for a particular component, the component is expected to inherit it from it's parent. This does not work for a button. I am setting a background color to a Frame and adding a button to it. The button still retains it's gray background and ignores the frame's background color. However, it inherits other properties such as Font and Foreground color. This works fine for other components.

This is reproducible atleast since 1.4 on Win32. Not reproducible on Solaris/Linux with XToolkit/Motif. 

I have attached a sample test. Execute the sample test. If the button does not appear in yellow color, the bug is reproduced.
###@###.### 2005-03-27 16:20:02 GMT

Comments
EVALUATION We already suggested the common fix for 5006707 and were rejected. We must fix the problem in a whole rather then fix one particular component. As far as I see, there are no much interest to this particular issue. But we have a request 6371452 which requires to (well, we probably will) change the spec. Moreover, compatibility (if even it is a wrong behaviour) is the thing we should count too. Seem fixing only buttons doesn't worth the effort.
04-07-2007

EVALUATION Believe all we should do is to eliminate that string from awt_Button.cpp : c->m_backgroundColorSet = TRUE; // suppress inheriting parent's color
30-05-2006

EVALUATION known issue 5006707 ###@###.### 2005-03-28 08:53:21 GMT
28-03-2005