-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
mantis
-
x86
-
windows_nt
Pressing mouse buttons in a certain way on java.awt.Buttons can cause two ActionEvents to be fired, instead of just one. Consider this simple test case:
// Test of double ActionEvents
import java.awt.*;
import java.awt.event.*;
public class ActionTest extends Frame implements ActionListener {
Button b;
public ActionTest() {
super("ActionTest");
b = new Button("Action Listening Button");
b.addActionListener(this);
add(b);
setSize(200, 200);
}
static int i = 0;
public void actionPerformed(ActionEvent e) {
System.out.println("actionPerformed() called - " + (i++));
}
public static void main(String[] args) {
ActionTest at = new ActionTest();
at.show();
}
}
---
Press both the left and right mouse buttons while over the Action Listening Button. Next, release the left mouse button. You will see that actionPerformed() is called twice. This is a regression since 1.3.1, and does not happen on Solaris. See also bug 4530087.
// Test of double ActionEvents
import java.awt.*;
import java.awt.event.*;
public class ActionTest extends Frame implements ActionListener {
Button b;
public ActionTest() {
super("ActionTest");
b = new Button("Action Listening Button");
b.addActionListener(this);
add(b);
setSize(200, 200);
}
static int i = 0;
public void actionPerformed(ActionEvent e) {
System.out.println("actionPerformed() called - " + (i++));
}
public static void main(String[] args) {
ActionTest at = new ActionTest();
at.show();
}
}
---
Press both the left and right mouse buttons while over the Action Listening Button. Next, release the left mouse button. You will see that actionPerformed() is called twice. This is a regression since 1.3.1, and does not happen on Solaris. See also bug 4530087.
- relates to
-
JDK-4530087 JCK14/13a,interactive: api/java_awt/interactive/FileDialogTests.html#FileDialogT
-
- Closed
-
-
JDK-4531852 MOUSE_RELEASED sent when FileDialog dismissed by double-clicking
-
- Open
-
-
JDK-5044469 REG: Disabled component gains focus and receives keyevents on win32
-
- Closed
-
-
JDK-4327679 MouseDragged,MouseReleased are not triggered by Button for Middle mouse button
-
- Closed
-