JDK-6730447 : Support for high resolution mouse wheel is still incomplete. AWT panel needs to be supported
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-07-28
  • Updated: 2011-03-11
  • Resolved: 2009-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u14 b03Fixed 7Fixed
Related Reports
Relates :  
Relates :  
Bug 6524352 support for high-resolution mouse wheel  has been  fixed in case that the MouseWheelListener is attached to a Frame or JFrame.

However, if the MouseWheelListener is tied to an AWT panel, the issue persists:

import java.awt.event.MouseWheelListener;
import java.awt.event.MouseWheelEvent;
//import javax.swing.*;
import java.awt.*;

public class Jmouse2 extends Frame {

    public Jmouse2() {
        this.setLayout(new BorderLayout());
        Panel ds_pnl = new Panel();
        this.add(ds_pnl, BorderLayout.CENTER);
        ds_pnl.addMouseWheelListener(new MouseWheelListener() {
            public void mouseWheelMoved(MouseWheelEvent e) {

    public static void main(String[] args) {
        Jmouse2 ms = new Jmouse2();

SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/6u14/6730447

EVALUATION The problem appears when an application has a top-level and the top-level contains at least one HW component. In the attached testcase the component is an AWT panel. The spec for the MouseWheelEvent classes says that "If MouseWheelEvents are not enabled on the Component, the event is delivered to the first ancestor Container with MouseWheelEvents enabled" AWT calls DefWindowProc for the mouse wheel events (AwtComponent::PostHandleEventMessage routine) and DefWindowProc propagates it up the parent chain until it finds a window that processes it, this window is top-level. The fix for 6524352 expects that it's OK to have toolkit-level variables to accumulate the mouse wheel messages. This works OK until the messages are propagated up to the HW parent. A possible fix for the problem would be to have component-level variables to accumulate the mouse wheel messages.

EVALUATION In fact the bug is not related to 6682046, the issue still exists in latest 6u10.

EVALUATION The root cause of the problem is the same as the cause of the bug 6682046. As a result of the bug 6682046 - if user resizes the frame, the content of the frame keeps the same size and any mouse event outside the content is missed. The issue shouldn't be reproducible using the latest build that includes the fix for the bug 6682046.