-
Bug
-
Resolution: Fixed
-
P2
-
5.0
-
b38
-
sparc
-
solaris_9
-
Verified
I have a frame with multiple menus added to the menubar. I am clicking on one of the menus and the respective menuitems drop-down. Now I am clicking on the same menu again and the drop-down disappears. Now I am pressing the left arrow. This triggers the following exception on XToolkit:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -2
at sun.awt.X11.XMenuBarPeer.getLeftSelected(XMenuBarPeer.java:473)
at sun.awt.X11.XMenuBarPeer.handleKeyPressOnEDT(XMenuBarPeer.java:522)
at sun.awt.X11.XMenuBarPeer$1.run(XMenuBarPeer.java:494)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:589)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
This is reproducible only on XToolkit and not on Motif. Not reproducible on Win32. Reproducible since 1.5.
I have attached a sample test. Execute the sample test. You would see a frame with multiple menus. Click on 'Message' menu on the menubar. The menu items will drop-down. Click again on the same menu. The drop-down will disappear. Now press the left arrow. You will see the above exception on the console.
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -2
at sun.awt.X11.XMenuBarPeer.getLeftSelected(XMenuBarPeer.java:473)
at sun.awt.X11.XMenuBarPeer.handleKeyPressOnEDT(XMenuBarPeer.java:522)
at sun.awt.X11.XMenuBarPeer$1.run(XMenuBarPeer.java:494)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:589)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
This is reproducible only on XToolkit and not on Motif. Not reproducible on Win32. Reproducible since 1.5.
I have attached a sample test. Execute the sample test. You would see a frame with multiple menus. Click on 'Message' menu on the menubar. The menu items will drop-down. Click again on the same menu. The drop-down will disappear. Now press the left arrow. You will see the above exception on the console.