JDK-8077006 : IllegalArgument Exception using 'Tab' key on JRadioButton inside JInternalFrame
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u40
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-03-30
  • Updated: 2015-10-15
  • Resolved: 2015-10-15
Related Reports
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux  (machine-name) 3.13.0-49-generic #81-Ubuntu SMP

EXTRA RELEVANT SYSTEM CONFIGURATION :
Any L&F that uses or references BasicRadioButtonUI is affected

A DESCRIPTION OF THE PROBLEM :
If a JRadioButton is placed in a JInternalFrame pressing the 'TAB' key in that field will lead to:

 java.lang.IllegalArgumentException: aContainer is not a focus cycle root of aComponent
	at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(SortingFocusTraversalPolicy.java:305)
	at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(LayoutFocusTraversalPolicy.java:106)
	at javax.swing.plaf.basic.BasicRadioButtonUI$ButtonGroupInfo.getFocusTransferBaseComponent(BasicRadioButtonUI.java:444)

The problem is caused in line 441 of BasicRadioButtonUI$ButtonGroupInfo.getFocusTransferBaseComponent(BasicRadioButtonUI.java)

Window container = SwingUtilities.getWindowAncestor(activeBtn);

Container is used as the Focus Cycle Root of the JRadioButton. However when using JInteralFrame the internal frame is the Focus Cycle Root so the above Exception is given.

The BasicRadioButtonUI should not assume Window is always the Focus Cycle Root for a JRadioButton. Other containers could have this role.

REGRESSION.  Last worked in version 7u76


REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Reopening to properly close as Duplicate instead of Fixed.
15-10-2015