-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2
-
beta
-
x86
-
windows_nt
Name: jk109818 Date: 06/16/2000
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, symcjit)
I create a JTree with the selection mode set to SINGLE_TREE_SELECTION. When I
change the tree selection holding down the SHIFT key and clicking the mouse on
different nodes, the selection does not change if the selection is below the
node that was selected when I first pressed the SHIFT key.
For example, in the example below, if Red is selected when I hold press the
SHIFT key, the selection changes as expected if I click Colors or Blue (with the
SHIFT down), but not if I click Green or Yellow.
Colors
- Blue
- Red
- Green
- Yellow
Below is the test class I used to localize the problem.
import java.awt.BorderLayout;
import javax.swing.JTree;
import javax.swing.JFrame;
import javax.swing.tree.TreeSelectionModel;
public class TreeExample
{
public TreeExample()
{
JTree tree = new JTree();
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTI
ON);
JFrame frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(tree, BorderLayout.CENTER);
frame.setSize(400, 300);
frame.setVisible(true);
}
public static void main(String args[])
{
new TreeExample();
}
}
(Review ID: 102809)
======================================================================
- relates to
-
JDK-4406418 Problems with Keyboard navigation in a SINGLE SELECTION Jtree
-
- Resolved
-