|
Quick Lists
|
|
Bug ID:
|
4408233
|
|
Votes
|
0
|
|
Synopsis
|
keyboard navigation in JTree - implementing Return breaks default button
|
|
Category
|
java:classes_swing
|
|
Reported Against
|
1.3
|
|
Release Fixed
|
1.4(merlin-beta)
|
|
State
|
10-Fix Delivered,
bug
|
|
Priority:
|
3-Medium
|
|
Related Bugs
|
|
|
Submit Date
|
25-JAN-2001
|
|
Description
|
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.
|
|
Work Around
|
tree.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "foo");
xxxxx@xxxxx 2001-03-02
|
|
Evaluation
|
Submitter is right. JTree should not bind return as this will conflict with default button bindings, it has been removed.
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |