-
Bug
-
Resolution: Fixed
-
P3
-
1.0.1, 1.2.0, 1.4.1, 1.4.2, 5.0
-
beta
-
generic, x86, sparc
-
generic, solaris_2.5.1, solaris_2.6, windows_nt, windows_xp
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
- duplicates
-
JDK-4199382 Swing Menus - text/icon/checkmark alignment schemes severely broken
- Closed
-
JDK-6181935 Swing Menu items with and without images should be aligned
- Closed
-
JDK-4133790 Motif L+F JCheckBoxMenuItems don't align the text properly
- Closed
-
JDK-4991607 Wrong insets for JMenuItem with icon and text
- Closed
- relates to
-
JDK-6458123 Bugs in menu item layout
- Closed
-
JDK-6568559 JPopupMenu has incorrect size when it contains Icons and Text JMenuItems
- Closed
-
JDK-6176159 Disabled menu items are shifted one pixel to the left in Windows L&F
- Closed
-
JDK-6197830 Fix for 4729669 does not work on Motif and GTK look and feels
- Resolved
-
JDK-6385366 REGRESSION: Descriptive text and accelerator text overlap on JMenuItem.
- Resolved