JDK-4991598 : Win L&F: Icon glyph for radio button menu item is wrong in winxp L&F
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-02-10
  • Updated: 2004-10-13
  • Resolved: 2004-09-22
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

Name: gm110360			Date: 02/09/2004


FULL PRODUCT VERSION :
1.5 Beta 1

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

EXTRA RELEVANT SYSTEM CONFIGURATION :
Not Applicable

A DESCRIPTION OF THE PROBLEM :
Using windows XP L&F in swing, Icon glyph for radio button menu item is wrong.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Screenshot comparisons can be seen on the following link:
https://winlaf.dev.java.net/release_0.4.html#Issue16

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Use the following SWING PATCH/HACK:
https://winlaf.dev.java.net/release_0.4.html
(Incident Review ID: 237454) 
======================================================================

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

SUGGESTED FIX Name: azR10139 Date: 03/15/2004 *** /net/fatum/ws/tiger/webrev/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java- Mon Mar 15 18:32:53 2004 --- WindowsLookAndFeel.java Mon Mar 15 18:00:33 2004 *** 1580,1589 **** --- 1580,1593 ---- Object radioButtonIcon = new SwingLazyValue( "com.sun.java.swing.plaf.windows.WindowsIconFactory", "getRadioButtonIcon"); + Object radioButtonMenuItemIcon = new SwingLazyValue( + "com.sun.java.swing.plaf.windows.WindowsIconFactory", + "getRadioButtonMenuItemIcon"); + Object menuItemCheckIcon = new SwingLazyValue( "com.sun.java.swing.plaf.windows.WindowsIconFactory", "getMenuItemCheckIcon"); Object menuItemArrowIcon = new SwingLazyValue( *** 1628,1637 **** --- 1632,1642 ---- "CheckBox.icon", checkBoxIcon, "Menu.arrowIcon", menuArrowIcon, "MenuItem.checkIcon", menuItemCheckIcon, "MenuItem.arrowIcon", menuItemArrowIcon, "RadioButton.icon", radioButtonIcon, + "RadioButtonMenuItem.checkIcon", radioButtonMenuItemIcon, "InternalFrame.layoutTitlePaneAtOrigin", new XPValue(Boolean.TRUE, Boolean.FALSE), }; *** /net/fatum/ws/tiger/webrev/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java- Mon Mar 15 18:32:52 2004 --- WindowsIconFactory.java Mon Mar 15 18:31:31 2004 *** 494,504 **** { public void paintIcon(Component c, Graphics g, int x, int y) { AbstractButton b = (AbstractButton) c; ButtonModel model = b.getModel(); if (b.isSelected() == true) { ! g.fillArc(0,0,getIconWidth()-2, getIconHeight()-2, 0, 360); } } public int getIconWidth() { return 12; } public int getIconHeight() { return 12; } --- 494,505 ---- { public void paintIcon(Component c, Graphics g, int x, int y) { AbstractButton b = (AbstractButton) c; ButtonModel model = b.getModel(); if (b.isSelected() == true) { ! g.fillRoundRect(x+3,y+3, getIconWidth()-6, getIconHeight()-6, ! 4, 4); } } public int getIconWidth() { return 12; } public int getIconHeight() { return 12; } ======================================================================
23-09-2004

EVALUATION Name: azR10139 Date: 03/15/2004 There are two problems with the RadioButtonMenuItems in Windows L&F: 1. We are not registering WindowsIconFactory's generated class that paints selection mark in WindowsLookAndFeel class. Because of this we are using BasicIconFactory methods to do so. 2. The method that exists in the WindowsIconFactory does not paibt selection mark correctly (Mark is too big and not centered). To fix this i suggest to add the code that will initialize the WindowsIconFactory inner class to paint selection mark for RadioButtonMenuItems and to fix this class to paint mark correctly. Due to the bug in Java2D code small circles is being painted incorrectly (fuzzy). To avoid this problem i suggest to paint mark as rounded rectangle. See Suggested Fix section for the diffs. ###@###.### 03/15/2004 ======================================================================
15-03-2004