Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6730447
Votes 0
Synopsis Support for high resolution mouse wheel is still incomplete. AWT panel needs to be supported
Category java:classes_awt
Reported Against b06
Release Fixed 6u14(b03), 7(b55) (Bug ID:2172959)
State 11-Closed, Verified, bug
Priority: 3-Medium
Related Bugs 6524352 , 6803452
Submit Date 28-JUL-2008
Description
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() {
        super("Jmouse2");
        this.setLayout(new BorderLayout());
        Panel ds_pnl = new Panel();
        ds_pnl.setBackground(Color.green);
        this.add(ds_pnl, BorderLayout.CENTER);
        ds_pnl.addMouseWheelListener(new MouseWheelListener() {
            public void mouseWheelMoved(MouseWheelEvent e) {
                System.out.println(e);
            }
        });
    }

    public static void main(String[] args) {
        Jmouse2 ms = new Jmouse2();
        ms.setVisible(true);
    }
}
Posted Date : 2008-07-28 12:45:10.0
Work Around
N/A
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.
Posted Date : 2008-08-18 08:09:13.0

In fact the bug is not related to 6682046, the issue still exists in latest 6u10.
Posted Date : 2008-09-25 13:19:32.0

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.
Posted Date : 2009-01-30 11:48:16.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang