-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.4, 1.1.8, 1.3.0
-
x86
-
windows_95, windows_nt
Name: rm29839 Date: 10/29/97
The JDK documentation for java.awt.List states
that the "AWT also generates an action event when
the user presses the return key while an item in
the list is selected." In Windows 95 and Windows NT
it doesn't. (In OS/2 it does.)
The JDK documentation for java.awt.List states
that the "AWT also generates an action event when
the user presses the return key while an item in
the list is selected." In Windows 95 and Windows NT
it doesn't. (In OS/2 it does.)
***********************************************
import java.awt.*;
import java.awt.event.*;
class ListAction extends Frame {
/* Demonstrates that no action event is produced
when <Enter> is pressed. */
static long currentMillis = System.currentTimeMillis();
static Runtime rt = Runtime.getRuntime();
public static void main(String[] args) {
new ListAction();
}
ListAction() {
super("ListAction Test Frame");
setSize(300,300);
Panel pnl1 = new Panel();
add(pnl1);
pnl1.setLayout(new BorderLayout());
List list = new List();
for(int i=0; i < 5; i++) {
list.addItem("Item " + i);
}
pnl1.add(list);
list.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
System.out.println("actionPerformed");
}
});
list.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ev) {
System.out.println("itemStateChanged");
}
});
setVisible(true);
}
}
(Review ID: 14631)
======================================================================
- duplicates
-
JDK-4234245 the actionEvent is not invoked when hit enter on list.
-
- Closed
-