-
Bug
-
Resolution: Fixed
-
P3
-
6, 7
-
b14
-
generic, x86
-
windows, windows_xp
-
Verified
In the context of Sun's collaboration with NASA we have found that there is a regression in the dispatching of mouse wheel events to applets in certain situations. The attached test case illustrates the problem. Enable the Java Console and open the index.html. Clicking in the blue area of the browser-external Frame and moving the scroll wheel should print mouse wheel events. With Java 5, clicking in the applet's area on the web page and moving the mouse wheel should have the same result. With Java 6, clicking in the applet's area on the web page and moving the mouse wheel results in no mouse wheel events being generated.
The test case consume()s the events as they come in to the various listeners. It has been discovered that not consuming these events works around this issue, and this workaround has been suggested to NASA. Nonetheless, we should understand better why the difference in behavior occurred with Java 6.
Note that as far back as JDK 1.4.2 the consumption of the mouse press events seems to defeat Java's focus mechanism, so that clicking in either of the windows and typing any keys does not result in key press events. Since mouse wheel event dispatching seems to be focus-related as well, it might seem reasonable that mouse wheel events also would not be sent; but they are with Java 5. The difference in behavior also appears only when running within the Java Plug-In, so it is likely to be related to the WEmbeddedFrame implementation or the plug-in's subclasses thereof.
The test case consume()s the events as they come in to the various listeners. It has been discovered that not consuming these events works around this issue, and this workaround has been suggested to NASA. Nonetheless, we should understand better why the difference in behavior occurred with Java 6.
Note that as far back as JDK 1.4.2 the consumption of the mouse press events seems to defeat Java's focus mechanism, so that clicking in either of the windows and typing any keys does not result in key press events. Since mouse wheel event dispatching seems to be focus-related as well, it might seem reasonable that mouse wheel events also would not be sent; but they are with Java 5. The difference in behavior also appears only when running within the Java Plug-In, so it is likely to be related to the WEmbeddedFrame implementation or the plug-in's subclasses thereof.
- duplicates
-
JDK-6523306 SWT_AWT: Focus problem in Java 6
- Closed