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

keyboard navigation in JTree - implementing Return breaks default button

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • client-libs
    • None
    • beta
    • generic
    • generic

      Suppose you want to create a simple dialog box to allow the user to choose an element from a JTree. The dialog box consists of the JTree, an OK button, and a Cancel button. OK is the default button and so can be executed by hitting return.

      A typical usage scenario (I have witnessed this in usability tests) is this:
      Open the dialog box.
      Select the desired node.
      Hit return to commit to the selection and close the dialog box.

      Under jdk 1.3, the result of this is the the selected node will be expanded or collapsed, and the OK button will not be invoked.

      Return was implemented to expand or collapse a node (along with a number of other key bindings) in jdk1.3 through bugs 4108480, 4108482, and 4112282.

      The Java Look and Feel Guidelines do not specify that Return should do anything on a JTree. In fact, binding Return actually *decreases* keyboard accessibility as described above.

            svioletsunw Scott Violet (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: