-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
beta
-
x86
-
windows_nt
Name: yyT116575 Date: 01/19/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
There are a number of problems with JTree when SingleSelection is enabled in
Windows Look And feel.
Problem no 1: Shift Key + UP - DOWN keys does not work as a Windows native
tree.
run the program and press the DOWN key in the Keyboard to select the First
element of the tree..After that leave the keys. Now hold down the SHIFT key and
press DOWN key (Or hold down the SHIFT KEY and press the left Mouse Button).
You can notice that the selection does not change on both the situations, while
actually the selection should have changed.
Problem no 2:
run the program and press the DOWN key in the Keyboard to select the First
element of the tree..After that leave the keys. Now hold down the SHIFT key and
press DOWN key 2 times. Now you can see as per the display the selection is still
on the first element(Problem 1). Now leave the keys and just press DOWN key
without Shift, You can see that the selection goes to the fourth node.The problem
is when the selection was on the first node the down key should have taken the
selection to the second node rather than the fourth node. This happens with
the CTRL key also (When Problem 1 is solved, this will automatically get solved)
There are some other problems also happening with a SINGLE_SELECTION Tree when
using Keyboard to navigate within the Tree. But those problems are
inconsistent,so not easily reproducible and I am too hardpressed
for time to find out the exact condition on which those problems occur and so I
don't mention them here. I would appreciate if you could thoroughly test the
keyboard navigation after rectifying the above mentioned problems..
-------------- source code ------------------------
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
public class SelectionTest extends JFrame {
private JTree tree;
private SelectionTest() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch(Exception ex) {
}
String[] treeElements ={"One","Two","Three","Four","Five","Six","Seven"};
tree = new JTree(treeElements);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
getContentPane().add(tree);
pack();
show();
}
public static void main(String[] args) {
new SelectionTest();
}
}
(Review ID: 115464)
======================================================================
- relates to
-
JDK-4346135 Single Selection Tree does not change selection with SHIFT
-
- Resolved
-