JDK-6394735 : Win L&F: Some buttons have wrong background color when using Silver XP theme
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-03-07
  • Updated: 2010-04-02
  • Resolved: 2006-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
From the original submitter:

FULL PRODUCT VERSION :
java version "1.6.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-beta-b59)
Java HotSpot(TM) Client VM (build 1.6.0-beta-b59, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
The WindowsXP look&feel uses a wrong background color for JButtons in a toolbar when the silver theme is displayed. The background color for JButtons is different from JToggleButtons and JToolbars, which looks quite awkward in some cases. This problem does not occur with the Blue (default) and Olive Green themes.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
  To see the correct behaviour set the theme on Windows XP to Blue or Olive Green, and start the test case. The four buttons at the top right (next to the combo box) all have the same background.

Close the file dialog and change the Windows XP theme to Silver. Start the application again and you will see that the first two of the four buttons have a different (darker) background color. These two buttons are JButtons, the other two are JToggleButtons.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
JButtons in a toolbar should have the same background color as JToggleButtons and JToolbars.
ACTUAL -
The background color of JButtons is different from JToggleButtons and JToolbars when the Silver theme is used.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;

public class WinXPButtonTest {

  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    JFileChooser jFileChooser = new JFileChooser();
    jFileChooser.showOpenDialog(null);
    System.exit(0);
  }

}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Unknown

Comments
EVALUATION The fix for 6418117 fixes this bug, but it may just be hiding it. The correct solution depends on the larger issue described in 6434931.
14-06-2006

EVALUATION Added a reference to the bug 6434931 which addresses the larger opacity/bgcolor issue and should allow this bug to be resolved.
06-06-2006

EVALUATION This may be an issue with the background color of the toolbar itself not matching the background color if the root panel. The solution seems to be complicated because in Wordpad the color of the toolbar is different than it's background, yet in a native file chooser the toolbar matches. In Stylebuilder the visual style for the toolbar seems to indicate that it should use Toolbar Fill (Button Face), which it does.
27-03-2006