JDK-5003968 : Foreground color set on JSlider is not used for painting labels
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-02-26
  • Updated: 2004-10-13
  • Resolved: 2004-09-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 6
6 betaFixed
Related Reports
Relates :  
Description
When foreground color is set on JSlider, the color is used only for painting the ticks. The color is not set for labels of JSlider (screenshot attached) If foreground color is set, it must be used for labels as well.


The behaviour is LAF dependent.
1) Metal   -> Ticks are painted using foreground color
2) Motif   -> Thumnails are painted using foreground color
3) Windows -> Foreground color is not used at all
4) GTK     -> Foreground color is used for ticks and value (not for labels)

Compile and run JSliderTest.java

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang FIXED IN: mustang INTEGRATED IN: mustang
14-09-2004

EVALUATION Name: apR10133 Date: 03/01/2004 Developers could set the label's foreground color directly to the labels. If slider's fg color will take an effect on labels we will lost the ability to set the tick's and label's colors to the different values. ###@###.### ======================================================================
14-09-2004

WORK AROUND Name: apR10133 Date: 03/01/2004 Set labels foreground expicitly: if (dictionary != null) { Enumeration keys = dictionary.keys(); while ( keys.hasMoreElements() ) { Component label = (Component)dictionary.get( keys.nextElement() ); if (label instanceof JComponent) { JComponent jlabel = (JComponent)label; label.setForeground(Color.yellow); } } } ###@###.### ======================================================================
14-09-2004