JDK-4729669 : 1.4 REGRESSION: Text edge of different types of JMenuItems are not aligned
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.0.1,1.2.0,1.4.1,1.4.2,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    generic,solaris_2.5.1,solaris_2.6,windows_nt,windows_xp generic,solaris_2.5.1,solaris_2.6,windows_nt,windows_xp
  • CPU: generic,x86,sparc
  • Submitted: 2002-08-10
  • Updated: 2005-05-12
  • Resolved: 2005-05-12
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
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Name: jk109818			Date: 08/09/2002


FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


FULL OPERATING SYSTEM VERSION :
Windows NT Version 4.0
(SP 4)

A DESCRIPTION OF THE PROBLEM :
The beginning edge of the text in JMenuItems (left edge in
English) does not line up with the text edge of
JRadioButtonMenuItems and JCheckBoxMenuItems.  Specifically:

In the Metal and Motif look and feels, JRadioButtonMenuItems
and JCheckBoxMenuItems line up with each other, but not with
plain JMenuItems.  Real Motif menus line up all text edges
in a menu.

In the Windows look and feel, JCheckBoxMenuItems and
JMenuItems line up with each other, but
JRadioButtonMenuItems do not line up with them.  This is a
regression from JDK 1.3.1.

All of the above appearance bugs are also in JDK 1.4.0.

REGRESSION.  Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JMenu (or JPopupMenu) with some JCheckBoxMenuItems,
some JRadioButtonMenuItems, and some plain JMenuItems.

EXPECTED VERSUS ACTUAL BEHAVIOR :
The leading edges of the text of all items in a JMenu should
be aligned horizontally;  that is, all menu item text should
start at the same x-coordinate.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
// This does not take any steps to change the Swing look and feel, but that
// can be done with the swing.defaultlaf system property.

import java.awt.*;
import javax.swing.*;

public class MenuItemTest
{
    public static void main(String[] args)
    {
        JMenu menu = new JMenu("View");
        menu.setMnemonic('V');

        menu.add(new JMenuItem("Refresh"));
        menu.add(new JMenuItem("Customize..."));
        menu.add(new JCheckBoxMenuItem("Show Toolbar"));
        menu.addSeparator();
        menu.add(new JRadioButtonMenuItem("List"));
        menu.add(new JRadioButtonMenuItem("Icons"));

        JFrame frame = new JFrame("Menu Item Test");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JMenuBar menuBar = new JMenuBar();
        menuBar.add(menu);
        frame.setJMenuBar(menuBar);

        frame.setSize(300, 300);
        frame.show();
    }
}

---------- END SOURCE ----------

Release Regression From : 1.3.1
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 160601) 
======================================================================
###@###.### 10/9/04 13:18 GMT

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
02-10-2004

EVALUATION Yes, they should line up nicely. ###@###.### 2002-10-18
18-10-2002