JDK-4797621 : REGRESSION:Component.requestFocus doesn't work
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2002-12-23
  • Updated: 2005-09-15
  • Resolved: 2005-09-15
Related Reports
Relates :  
Description
###@###.### 2002-12-23

J2SE Version (please include all output from java -version flag):
  java version "1.4.2-beta"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b10)
  Java HotSpot(TM) Client VM (build 1.4.2-beta-b10, mixed mode)

Does this problem occur on J2SE 1.3 or 1.4?  Yes / No (pick one)
  works fine with 1.3.1, but fail on 1.4

Operating System Configuration Information (be specific):
  Windows XP SP1

Hardware Configuration Information (be specific):
  IBM Thinkpad A20p, 384Mb ram

Bug Description:

  Component.requestFocus doesn't work at all

Steps to Reproduce (be specific):
  
  Run the attached test case MantisAwtBugs and check the focus.

Comments
WORK AROUND Name: osR10079 Date: 12/25/2002 If you want to receive KeyEvents for all focus traversal keys, you may use Component.setFocusTraversalKeysEnabled(boolean). The drawback of this approach is that you will have to process all these events on the component. If you want that some component doesn't receive focus you may use Component.setFocusable() (1.4 and later) or override Component.isFocusTraversable() to return false. ###@###.### 2002-12-25 ======================================================================
25-12-2002

EVALUATION Name: osR10079 Date: 12/25/2002 The testcase tries to manage focus transfer using KeyListener which transfers focus to the next/previous component in response to Tab/Shift-Tab. But according to Focus Specification Tab and Shift-Tab are focus traversal keys by default and components don't receive KeyEvent for them. Thus the problem is that some KeyEvents don't arrive, not with requestFocus(). ###@###.### 2002-12-25 ======================================================================
25-12-2002