JDK-4279715 : Regression test bug4199401 fails while running with Kestrel FCS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 1999-10-09
  • Updated: 2000-10-23
  • Resolved: 2000-10-23
Related Reports
Duplicate :  
Description
Regression test bug4199401 fails while running with Kestrel FCS E, F, G, H, and I.  Pressing the Ctrl-i keys does nothing.

path: test/javax/swing/JInternalFrame/4199401/Ctrli.java
author Hania Gajewska

This occurs in the following machines:
blueyes (SunOS 5.7)
bluenote (Windows NT and 95)
jfcsqe-jupiter (Windows 98)

Comments
EVALUATION The "key typed" event for Ctrl-I always consumed by DefaultFocusManager.processKeyEvent() method. Modifiers was never delivered for "key typed" event until it was fixed (see 4193779 and 4209844) but Ctrl-I and Ctrl-TAB is exactly the same now. We should not consume KeyEvent.KEY_TYPED events, after Ctrl-I pressed event in order to give this event to the key listeners. andrey.pikalev@Eng 2000-04-20 Name: apR10133 Date: 10/11/2000 The bug is not reproducible after the focus management enhancements. ###@###.### ======================================================================
11-06-2004

SUGGESTED FIX ------- DefaultFocusManager.java ------- *** /tmp/dWqV4b_ Thu Apr 20 11:11:53 2000 --- DefaultFocusManager.java Thu Apr 20 11:04:33 2000 *************** *** 27,32 **** --- 27,35 ---- public class DefaultFocusManager extends FocusManager { Stack history = new Stack(); + + protected boolean ctrlIPressed = false; + /** * This method is called by a <code>JComponent</code> when a key event * occurs. <code>JComponent</code> *************** *** 57,67 **** if(focusedComponent instanceof JComponent) { JComponent fc = (JComponent) focusedComponent; if(fc.isManagingFocus()) { ! int isctrl = (anEvent.getModifiers() & ! ActionEvent.CTRL_MASK); ! if ((isctrl != ActionEvent.CTRL_MASK) || ! (anEvent.getKeyCode() == KeyEvent.VK_I)) return; } } --- 60,81 ---- if(focusedComponent instanceof JComponent) { JComponent fc = (JComponent) focusedComponent; if(fc.isManagingFocus()) { ! int isctrl = (anEvent.getModifiers() & ! ActionEvent.CTRL_MASK); ! if (isctrl != ActionEvent.CTRL_MASK) { return; + } else if (anEvent.getKeyCode() == KeyEvent.VK_I) { + if (anEvent.getID() == KeyEvent.KEY_PRESSED) + ctrlIPressed = true; + return; + } else if ((anEvent.getKeyCode() == KeyEvent.VK_TAB) && + (anEvent.getID() == KeyEvent.KEY_PRESSED)) { + ctrlIPressed = false; + } else if (ctrlIPressed && + (anEvent.getID() == KeyEvent.KEY_TYPED)) { + ctrlIPressed = false; + return; + } } } andrey.pikalev@Eng 2000-04-20
20-04-2000