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

Single Selection Tree does not change selection with SHIFT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • 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)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: