Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4656461
Votes 4
Synopsis Cannot Ctrl-Shift-Click to create disjoint selection interval in list
Category java:classes_swing
Reported Against 1.4
Release Fixed mustang(b20), 5.0u3(b02) (Bug ID:2122123) , 1.4.2_10(b01) (Bug ID:2122137)
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 6221613
Submit Date 21-MAR-2002
Description




FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


Observed on  customer  Linux 6.1, JDK 1.4.0 and 1.3.1_02, kernel
2.2.12, Enlightenment window manager. Same on Win2K/1.4.0.

A DESCRIPTION OF THE PROBLEM :
In Metal L&F, I would expect that the gesture
Ctrl-Shift-Click on a list or tree would extend a selection
from the previously selected item (like Shift-Click does)
without clearing other disjoint selections (like Ctrl-Click
does). At least on Windows, this is normal behavior, and I
expected it to work in Metal L&F as well, but it did not.

Compare NetBeans/Forte for Java bug, closed as a Swing
problem:

http://www.netbeans.org/issues/show_bug.cgi?id=3714

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run demo program. Click "one" in the list. Ctrl-click
"three". Ctrl-shift-click "five".

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: one, three, four, and five are selected. Actual:
one, three, and five are selected, but four is not - same as
if the last step had been to ctrl-click "five" without the
Shift modifier.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
public class TreeSelectionTest {
    public static void main(String[] args) {
        JTree tree = new JTree(new Object[] {
            "one",
            "two",
            "three",
            "four",
            "five",
        });
        JList list = new JList(new Object[] {
            "one",
            "two",
            "three",
            "four",
            "five",
        });
        JFrame f = new JFrame("Test tree selection");
        f.getContentPane().add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tree,
list));
        f.pack();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    }
}

---------- END SOURCE ----------

CUSTOMER WORKAROUND :
If no long ranges (only short ones) need be selected, just
use Ctrl-click for every item. If only one long range need
be selected, do it first with Shift-click, then add
individual items with Ctrl-click. If more than one long
range needs to be selected, you are out of luck.
(Review ID: 144376) 
======================================================================
Work Around
N/A
Evaluation
Yes, it would be nice to implement this behavior.
  xxxxx@xxxxx   2003-08-05

Fix is in progress. Table, tree, and list will be changed to support this type of selection. The fix involves minor changes in BasicListUI, BasicTableUI, and BasicTreeUI to handle the CTRL-SHIFT combination. In addition, the spec of JTable.changeSelection will change slightly.
  xxxxx@xxxxx   2005-1-05 16:32:03 GMT
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang