-
Bug
-
Resolution: Unresolved
-
P4
-
1.2.0
-
sparc
-
solaris_2.6
On Solaris, button receive no mouseExited event when overlapped
by a modal dialog.
The code below demonstrates the problem. Place mouse pointer over
the button. It will receive mouseEntered event. Then press the
button. A modal dialog pops up, but the button receives no
mouseExited event.
This bug occurs on Solaris only. It seems to first appear in
1.1.7 and exist in all versions since. If the dialog is not
modal, it doesn't occur.
--------- Test case -----------
import java.awt.*;
import java.awt.event.*;
/* Button doesn't receive mouseExited event when covered by a modal dialog.
* Run `java AWTDemo' for modal, and
* `java AWTDemo -ok' for non-modal Dialog
*/
public class AWTDemo extends Frame {
Button b1;
boolean modal;
public AWTDemo(boolean isModal) {
super("ButtonDemo");
modal = isModal;
b1 = new Button("button");
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Dialog d = new Dialog(AWTDemo.this, "foo", modal);
d.setSize(200,200);
d.show();
}
});
b1.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent ev) {
b1.setLabel("Entered");
System.out.println("Entered");
}
public void mouseExited(MouseEvent ev) {
b1.setLabel("Exited");
System.out.println("Exited");
}
});
add(b1);
}
public static void main(String[] args) {
boolean modal = true;
if (args.length > 0 && args[0].equals("-ok")) modal = false;
Frame frame = new AWTDemo(modal);
frame.pack();
frame.show();
}
}
###@###.### 2000-03-10
by a modal dialog.
The code below demonstrates the problem. Place mouse pointer over
the button. It will receive mouseEntered event. Then press the
button. A modal dialog pops up, but the button receives no
mouseExited event.
This bug occurs on Solaris only. It seems to first appear in
1.1.7 and exist in all versions since. If the dialog is not
modal, it doesn't occur.
--------- Test case -----------
import java.awt.*;
import java.awt.event.*;
/* Button doesn't receive mouseExited event when covered by a modal dialog.
* Run `java AWTDemo' for modal, and
* `java AWTDemo -ok' for non-modal Dialog
*/
public class AWTDemo extends Frame {
Button b1;
boolean modal;
public AWTDemo(boolean isModal) {
super("ButtonDemo");
modal = isModal;
b1 = new Button("button");
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
Dialog d = new Dialog(AWTDemo.this, "foo", modal);
d.setSize(200,200);
d.show();
}
});
b1.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent ev) {
b1.setLabel("Entered");
System.out.println("Entered");
}
public void mouseExited(MouseEvent ev) {
b1.setLabel("Exited");
System.out.println("Exited");
}
});
add(b1);
}
public static void main(String[] args) {
boolean modal = true;
if (args.length > 0 && args[0].equals("-ok")) modal = false;
Frame frame = new AWTDemo(modal);
frame.pack();
frame.show();
}
}
###@###.### 2000-03-10
- relates to
-
JDK-4233063 Shouldn't mousePressed and mouseReleased be called synchroniouse?
-
- Open
-