JDK-4314194 : JRadioButton subclasses do not use configured color for disabled foreground
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-02-19
  • Updated: 2001-01-31
  • Resolved: 2001-01-31
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.
Other
1.4.0 betaFixed
Description

Name: krT82822			Date: 02/19/2000


java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)

In Java look and feel (Metal), subclasses of JRadioButton (including
JCheckBox) do not use the configured color for foreground when disabled.

Actually, MetalRadioButtonUI uses "getBackground().darker()" to compute the
disabled text color in the paint() method.
It should call the getDisabledTextColor() method instead.

(see also 4233965, 4199390)
(Review ID: 100622) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin merlin-beta FIXED IN: merlin merlin-beta INTEGRATED IN: merlin-beta
24-08-2004

EVALUATION Name: keR10081 Date: 06/27/2000 As said in the description, we should use not darker(), but UIManager.getColor(...). See suggested fix for necessary diffs. ###@###.### ======================================================================
24-08-2004

WORK AROUND Name: krT82822 Date: 02/19/2000 The following code works around the problem by overriding the darker() method of the background color for the JCheckBox: Color backgroundColor = UIManager.getColor("CheckBox.background"); final Color disabledTextColor = UIManager.getColor("CheckBox.disabledText"); UIManager.getDefaults().put("CheckBox.background", new Color (backgroundColor.getRGB()) { public Color darker() { return (disabledTextColor); } }); ======================================================================
24-08-2004

SUGGESTED FIX Name: keR10081 Date: 06/27/2000 ------- MetalRadioButtonUI.java ------- *** /tmp/dEFruR_ Tue Jun 27 14:23:57 2000 --- MetalRadioButtonUI.java Tue Jun 27 14:23:11 2000 *************** *** 177,183 **** textRect.x, textRect.y + fm.getAscent()); } else { // *** paint the text disabled ! g.setColor(b.getBackground().darker()); BasicGraphicsUtils.drawString(g,text,model.getMnemonic(), textRect.x, textRect.y + fm.getAscent()); --- 177,183 ---- textRect.x, textRect.y + fm.getAscent()); } else { // *** paint the text disabled ! g.setColor(UIManager.getColor(getPropertyPrefix()+"disabledText")); BasicGraphicsUtils.drawString(g,text,model.getMnemonic(), textRect.x, textRect.y + fm.getAscent()); ======================================================================
24-08-2004

PUBLIC COMMENTS .
24-08-2004