Red Hat Bugzilla – Bug 355571
Lightweight Components Respond Strangely to Mouse Events
Last modified: 2008-04-02 20:45:03 EDT
I will attach Dots.java and dots.html as soon as I have filed this bug.
Dots.java is an Applet that contains an instance of LightDots, which extends
Component and is therefore a Lightweight Component, and HeavyDots, which extends
Canvas and so isn't. Both are otherwise essentially identical. They draw a
filled oval in either blue or red, depending on their state. Each mouseReleased
event they receive toggles that state.
When I try this in Firefox using gcjwebplugin the HeavyDots instance is
clickable while the LightDots instance seems to ignore all events. However, the
static main method of Dots adds the same components to a Frame instead of an
Applet and both instances respond to clicks. For some reason the lightweight
component also responds when clicking on the heavyweight component in that case.
I tried this same simplistic applet against the Sun Java plugin on WindowsXP and
found exactly the behavior I would expect. Clicking either side works and
toggles only that side.
How reproducible: Always
Steps to Reproduce:
1. javac Dots.java
2. firefox dots.html
3. java Dots
Actual results: No response to mouse clicks on the left side when in applet form
and overzealous response on the left side to clicks on the right when used
within a Frame.
Expected results: Toggle only the side clicked, just as can be seen with the
Sun JDK on WindowsXP.
Created attachment 240791 [details]
Simplistic Applet/Application that demonstrates the problem.
Created attachment 240801 [details]
Simplistic web page to demonstrate problem as an Applet
Use OpenJDK instead. I tested this in applet and application form on i386
Rawhide against these packages:
and it worked fine. (Actually I modified dots.html to use the applet tag
instead of the object tag.)
Fair enough. Thanks.