Name: skT45625 Date: 05/10/2000
java version "1.3.0rc1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-U)
Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)
String [] data = {"one","two","three","four", "five", "six", "seven"};
javax.swing.JList JList2 = new javax.swing.JList( data );
sp2 = new javax.swing.JScrollPane(JList2);
sp2.setBounds( new java.awt.Rectangle( 450,100,100,100 ) );
JList2.setCellRenderer( new javax.swing.DefaultListCellRenderer() );
JList2.setName( "JList2" );
JList2.setValueIsAdjusting(false);
JList2.setSelectedIndices( new int[]{} );
JList2.setSelectionModel( new javax.swing.DefaultListSelectionModel( ) );
add(sp2);
select seven in the list. it should be set as the selectedindex. Hold down
control and click on three. Both seven and three should be selected, but three
should be the lead. Hold down control and press a to select all. Three should
stay as the lead, but the lead changes to the last item on the list, which is
seven. The listbox does not scroll down to make it visible if it is not.
Removing all works similar. Instead of pressing control-a, press control-\.
(Review ID: 103015)
======================================================================