Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4729669
Votes 15
Synopsis 1.4 REGRESSION: Text edge of different types of JMenuItems are not aligned
Category java:classes_swing
Reported Against 1.0.1 , 1.4.2 , 1.2fcs , tiger-beta , hopper-beta , swing1.0fcs
Release Fixed mustang(beta)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 6385366 , 6458123 , 6568559 , 6176159 , 6181935 , 6197830 , 4133790 , 4991607 , 4199382
Submit Date 10-AUG-2002
Description


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) 
======================================================================
  xxxxx@xxxxx   10/9/04 13:18 GMT
Work Around
N/A
Evaluation
Yes, they should line up nicely.
  xxxxx@xxxxx   2002-10-18
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang