JDK-4500685 : JCK1.4, interactive:api/javax_swing/interactive/JMenuItemTests.html#JMenuItem
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,linux,windows_2000
  • CPU: x86,sparc
  • Submitted: 2001-09-07
  • Updated: 2001-09-14
  • Resolved: 2001-09-12
Related Reports
Duplicate :  
Relates :  
Relates :  
Description

Name: asR10013			Date: 09/06/2001


JDK            : JDK1.4.0-beta-b78
JCK            : JCK1.4-b09, JCK1.3a
Platform[s]    : RedHat Linux 7.1, Windows 2000
switch/Mode    : -client -Xmixed -Xfuture
JCK test owner : http://javaweb.eng/jck/usr/owners.jto
Failing Test   : api/javax_swing/interactive/JMenuItemTests.html#JMenuItem [JMenuItemTest0003]

The test verifies menemonic behavior of JMenuItem(String, int) constructor.
However, menu items does not response to mnemonic keys when menu overlaps test's frame.


Test source location:
=====================
/net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/javax_swing/interactive/JMenuItemTests.java

jtr file location:
==================
/net/jtgb4u4c.eng/export/sail15/results/merlin/b78/jck14/linux/redhat7.1_smp_gnome_plugin_ns6.1_linux-24/workDir/api-interactive/javax_swing/interactive/JMenuItemTests_JMenuItem.jtr

How to reproduce:
====================
1. Run the following script (probably, you need to change JCK and JAVA_HOME paths)
2. Shrink test frame to make menu to ovrlap the frame when menu is opened.
3. Press Alt+m, then press 1.
4. Press Esc to close menu.

You will see that menu response to the keyboard (Esc key) hovewer it does not response to the mnemonic keys (1).


--------Script START---------------------
#!/bin/sh
JAVA_HOME=/net/jdk/export/disk8/local.java/jdk1.4/linux-i386
JCK=/net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14
export CLASSPATH="$JCK/classes:$JCK/javatest.jar"
executeClass="javasoft.sqe.tests.api.javax.swing.interactive.JMenuItem.JMenuItemTests -TestCaseID JMenuItemTest0003 -TestDirURL file:///$JCK/tests/api/javax_swing/interactive/JMenuItemTests.html#JMenuItem"
$JAVA_HOME/bin/java -Xfuture ${executeClass}
---------Script END----------------------

Test output:
=============
JMenuItemTest0003: Failed. JMenuItem setMnemonic() does not behave as expected.
STATUS:Failed.tests: 1; failed: 1; first test case failure: JMenuItemTest0003                                                                  

Specific Machine Info:
=====================
Hostname: linux-24
OS: RedHat Linux 7.1

Hostname: Linux-22
OS: Windows 2000 Professional

======================================================================

Comments
EVALUATION The problem is that the mnemonics does not work for heavy weight popup windows on all platforms. The arrow keys continue to work correctly. The regression is that the focus owner is never transfered to the JPopupMenu when the heavy weight popup appears. This regression was introduced between b73 (7/26) and b74 (08/01). This bug still exists in the latest (sept 10) nightly build. One very suspicious fix is for 4472032: Focus problem in JMenu. This was rolled back as a result of the showstopper 4492880. Another series of fixes which are suspicious are 4432422, 4449778 and 4111606. All these fixes are claimed to be integrated into b74 but only the last one is marked as integrated. A good interactive test case can be found at /home/davidson/ws/jmenu_test use "java MenuTest" to execute. You can force heavy weight popups by making the height of the frame smaller. The "start" button will output the current focus owner every 2 seconds. I'm going to reassing to AWT since there wasn't a Swing integration for b74. Hopefully, I've given them enough information to fix it quickly. ###@###.### 2001-09-10 Name: pzR10082 Date: 09/12/2001 This bug seems to describe the same problem as #4492892. Fix for bug 4492892 fixes this one too. ###@###.### 2001-09-12 ====================================================================== Name: pzR10082 Date: 09/27/2001 This bug is still reproducible on Solaris and Linux with B80, despite the fix integrated and working, i.e. focus is passed to popup menu when it appears. However, key events aren't sent to popup menu. When the popup appears: - Popup$HeavyWeightWindow becomes focused Window; - The popup menu becomes focus owner. This is correct. However, the popup menu does not receive key events, even though it owns focus. When i press a key, it seems no component receives notification. I can't find any single component on which dispatchEvent() is called. When we cancel the popup menu (using mouse), the main frame gets focus, and key events are processed properly. Looks like key event processing doesn't work when heavyweight popup appears. This is an AWT problem. ###@###.### 2001-09-27` ======================================================================
27-09-2001