JDK-4705205 : Cannot move focus using TAB / Shift TAB key, when running SwingSet2 demo under a
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-06-20
  • Updated: 2002-07-25
  • Resolved: 2002-07-25
Related Reports
Duplicate :  
Description

Name: dk106046			Date: 06/20/2002

Operating System:           Windows 2000
Full JDK version:           1.4.0_01-b03 and 1.4.1-beta-b14

Description of problem:  
When you run one of the demo programs such as SwingSet2, using appletviewer (i.e. 'appletviewer SwingSet2.html') using the TAB key does not allow you to move focus between components. 

As an example select the JButton, JRadioButton, JToggleButton, JCheckbox demo in SwingSet2. If you now select the Text Button labelled 'One' using the mouse it is shown as having the focus (blue rectangle around the text). If you now try to use the TAB key to move the focus to the TextButton labelled 'Two', it doesn't work.

Note that the same problem doesn't occur if the SwingSet2 demo is run using 'Java -jar SwingSet2.jar', but the same problem is seen with other demos such as Java2Demo.

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

Comments
EVALUATION Sounds pretty serious. Commit to fix in Mantis. ###@###.### 2002-07-22 Name: dmR10075 Date: 07/25/2002 When JApplet is loaded into AppletViewer or Plugin his top-level ancestor is not of Swing kind, but of AWT kind. For example, AppletViewer is Frame, not JFrame. When system asks JApplet for focus traversal policy(FTP) it gets this top-level (because it is nearest focus cycle root) and asks it for FTP. In result we get AWT FTP for Swing components which makes Swing components inside JApplet untraversable. To fix this problem we can either make Jpplet focus cycle root(FCR) so he will be asked for FTP and because it is Swing component it will return correct FTP. Or we can install correct (Swing) FTP on JApplet's parent so when parent is being asked for FTP it will return Swing one. There is also a Swing bug with the same description and cause - 4707289. It seems that this problem is more general - what we need is the ability for non-FCR to be asked for FTP. This will solve current problem. It might be also needed for developing of GUI: when you build a form from several pre-built containers, and focus traversal sequence is not defined globally but each container defines its own traversability inside of itself while not being FCR. We filed RFE for this - 4719336. When this RFE will be resolved the problem which caused this bug will disappear. As we need this bug fixed in Mantis we decided to modify JApplet to make it focus cycle root, later we will revert this change. As the change is in JApplet, Swing team agreed to fix their bug(4707289) and so we close this one as duplicate of that. ###@###.### 2002-07-25 ======================================================================
25-07-2002