JDK-6860433 : [Nimbus] Code to set a single slider's thumb background doesn't work as specified
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux_ubuntu
  • CPU: generic,x86
  • Submitted: 2009-07-14
  • Updated: 2011-01-19
  • Resolved: 2010-02-16
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 Other
7 b84Fixed OpenJDK6Fixed
Related Reports
Duplicate :  
Description
Attached is the example.  This little demo was written by Jasper and does not work as specified.  I was able to workaround the problem in one of two ways:
- Set the thumb background painter for all 7 states of the thumb.
OR
- Change the order that these two methods are called:
slider.putClientProperty("Nimbus.Overrides", sliderDefaults);
slider.putClientProperty("Nimbus.Overrides.InheritDefaults", false);

See bug 6752660 for more info on the putClientProperty ordering.

Comments
EVALUATION NimbusDefaults.LazyStyle caches overriding styles. The problem is, this cache should be cleared when overrides or inheritance mode change, because the style needs to be recomputed in this case. Changes to component name or hierarchy may also affect its style. The proposed solution is to move the cache into NimbusDefaults and make it store one style per Component per Region. A new method is introduced to clear the cache. It is called from a PCL once one of the properties above change.
17-12-2009