Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8077006

IllegalArgument Exception using 'Tab' key on JRadioButton inside JInternalFrame

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: