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: 6538132
Votes 0
Synopsis Regression: Pressing Escape key don't close the menu items from jdk7.0 b07 onwards
Category java:classes_swing
Reported Against
Release Fixed 7(b20)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6471949
Submit Date 23-MAR-2007
Description
I have a frame which contains menus & each menu is having around 50 menu items, which covers the whole screen length. I click on any menu to see the menu items & press escape key, so that menu item gets disappear. I move the mouse pointer to the next menu , I see that next menu's menuitems. I keep the mouse pointer on the  menu & try pressing Escape key , the menuitems closes & appears again & again. which is incorrect. This happens only when the mouse pointer is on the second & third menuitem. This is reproducable only in windows xp with windows look and feel. It works fine in jdk6.0 & jdk7.0 till b05 . It fails in jdk7.0 b07 onwards. Hence its a regression. 

Step to reproduce:
---------------
1) Run the attached program.
2) Maximize the frame.
3) Click on any menu. you can see the menuitems.
4) Press the escape key. Observe that menuitems gets disappear.
5) Move the mouse pointer to the next menu. Observe that you can see menu items.
6) Press escape key. Observe that menuitems gets disappear & appears again . If you see the same then the bug is reproduce.
Posted Date : 2007-03-23 11:43:11.0

Just a couple of comments:

To see how menus items appear and disappear you should move mouse to another menu after the step 6 (after pressing the ESCAPE key).

To reproduce the bug, a test code should set Windows Look and Feel. The attached test case should be modified. There is an example of working code:

=====Source Begin=====
import javax.swing.*;

public class Test{
    private JFrame frame = null;
    private JMenuBar menuBar = null;

    public static void main(String[] args) throws Exception {
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                new Test();
            }
        });
    }

    public Test() {
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (Exception e) {
            System.err.println(e);
        }

        frame = new JFrame();
        menuBar = new JMenuBar();
        for (int i = 0; i < 10; i++) {
            JMenu menu = new JMenu("Menu " + i);
            for (int j = 0; j < 50; j++) {
                JMenuItem menuItem = new JMenuItem("Item " + i + ", " + j);
                menu.add(menuItem);
            }
            menuBar.add(menu);
        }
        frame.setJMenuBar(menuBar);

        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
=====Source End======
Posted Date : 2007-06-25 16:32:37.0
Work Around
N/A
Evaluation
I can reproduce the bug under 7b07, 7b14 and cannot under 6u3b01.

The described behaviour differs from the native Windows one. Menu items shouldn't appear after pressing the ESCAPE key until you press a mouse button.
Posted Date : 2007-06-25 16:32:37.0

Probably the bug is a regression of 6471949.
Posted Date : 2007-06-26 08:41:40.0

That's right
This is regression of the 6471949
Posted Date : 2007-06-26 13:40:22.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang