-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1.4
-
sparc
-
solaris_2.5.1
Name: joT67522 Date: 11/04/97
When a List is in multiple select mode, the select
method is supposed to be ignored if the specified
List item is already selected. This is the case in
the Windows and OS/2 JDKs. However, with Solaris
the select method toggles the selection. See the
code below.
*************************************************
/*
Demonstrates that in Solaris List.select() toggles the selection
in a multipleMode List. */
import java.awt.*;
import java.awt.event.*;
class ListSelectTest extends Frame {
List list = new List();
Button button = new Button("OK");
public static void main(String[] args) {
new ListSelectTest();
}
ListSelectTest() {
setSize(300,200);
setLayout(new BorderLayout());
add("Center",list);
add("South",button);
list.setMultipleMode(true);
list.addItem("First");
list.addItem("Second");
list.addItem("Third");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
list.select(1); //select the second row
//Toggles in Solaris
}
});
setVisible(true);
}
}
(Review ID: 19299)
======================================================================