-
Bug
-
Resolution: Duplicate
-
P4
-
6
-
x86
-
windows_2000
J2SE Version (please include all output from java -version flag):
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b47)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b47, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
Yes
Operating System Configuration Information (be specific):
Microsoft Windows 2000 [Version 5.00.2195]
Hardware Configuration Information (be specific):
Pentium 4
Bug Description:
Extended Modifiers on Mouse Events are wrong
Following the steps produces the following Mouse Events:
java.awt.event.MouseEvent[MOUSE_ENTERED,(450,343),button=0,clickCount=0]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_PRESSED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_RELEASED,(329,251),button=1,modifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_EXITED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_ENTERED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on null.glassPane
The extended modifiers of the last 2 mouse events (after the Mouse
Button was Released) claim that the Button1 is still down.
Either these 2 events should come before the MOUSE_RELEASED event, or
the extended modifiers should not say that the Button1 is down, either
way something is wrong here.
Steps to Reproduce (be specific):
1) Run the code below
2) Press the Button
import java.awt.event.*;
import static java.lang.System.*;
import static javax.swing.JFrame.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.add(new JButton(new AbstractAction("Test") {
public void actionPerformed(ActionEvent anEvent) {
frame.getGlassPane().setVisible(true);
}
}) {
public void processMouseEvent(MouseEvent anEvent) {
out.println(anEvent);
super.processMouseEvent(anEvent);
}
});
frame.getGlassPane().addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent anEvent) {
out.println(anEvent);
}
public void mousePressed(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseReleased(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseEntered(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseExited(MouseEvent anEvent) {
out.println(anEvent);
}
});
frame.setSize(500, 500);
frame.setVisible(true);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
java version "1.6.0-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b47)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b47, mixed mode, sharing)
Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
Yes
Operating System Configuration Information (be specific):
Microsoft Windows 2000 [Version 5.00.2195]
Hardware Configuration Information (be specific):
Pentium 4
Bug Description:
Extended Modifiers on Mouse Events are wrong
Following the steps produces the following Mouse Events:
java.awt.event.MouseEvent[MOUSE_ENTERED,(450,343),button=0,clickCount=0]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_PRESSED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_RELEASED,(329,251),button=1,modifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_EXITED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on Test$2[...]
java.awt.event.MouseEvent[MOUSE_ENTERED,(329,251),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on null.glassPane
The extended modifiers of the last 2 mouse events (after the Mouse
Button was Released) claim that the Button1 is still down.
Either these 2 events should come before the MOUSE_RELEASED event, or
the extended modifiers should not say that the Button1 is down, either
way something is wrong here.
Steps to Reproduce (be specific):
1) Run the code below
2) Press the Button
import java.awt.event.*;
import static java.lang.System.*;
import static javax.swing.JFrame.*;
import javax.swing.*;
public class Test {
public static void main(String[] args) {
final JFrame frame = new JFrame();
frame.add(new JButton(new AbstractAction("Test") {
public void actionPerformed(ActionEvent anEvent) {
frame.getGlassPane().setVisible(true);
}
}) {
public void processMouseEvent(MouseEvent anEvent) {
out.println(anEvent);
super.processMouseEvent(anEvent);
}
});
frame.getGlassPane().addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent anEvent) {
out.println(anEvent);
}
public void mousePressed(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseReleased(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseEntered(MouseEvent anEvent) {
out.println(anEvent);
}
public void mouseExited(MouseEvent anEvent) {
out.println(anEvent);
}
});
frame.setSize(500, 500);
frame.setVisible(true);
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
- duplicates
-
JDK-6191390 Action Event triggered by list does not reflect the modifiers properly on win32
- Resolved
- relates to
-
JDK-4420110 Creating a new component under cursor does not fire mouseEntered()
- Open
-
JDK-4522626 User-constructed MouseEvents don't have correct modifiers
- Open
-
JDK-6317481 REG:Pressing the mouse, dragging and releasing it outside the button triggers ActionEvent, XAWT
- Closed