United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6860433 [Nimbus] Code to set a single slider's thumb background doesn't work as specified
JDK-6860433 : [Nimbus] Code to set a single slider's thumb background doesn't work as specified

Details
Type:
Bug
Submit Date:
2009-07-14
Status:
Resolved
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2010-02-16
Component:
client-libs
OS:
linux_ubuntu,generic
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10,7
Fixed Versions:

Related Reports
Backport:
Duplicate:
Relates:

Sub Tasks

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.
                                     
2009-12-17



Hardware and Software, Engineered to Work Together