JDK-4982522 : SWT/AWT embedding Frame does not get Mouse events on Windows.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-01-23
  • Updated: 2009-06-15
  • Resolved: 2009-06-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.
Below is the email from Silenio from SWT/Eclipse team.
> Hi Bino,
> I have this problem with lightweights on Windows and I was wondering if it
> could
> be fixed in AWT or worked around some other way.
> The problem is that Swing components (or any lightweight) will not receive
> mouse events, if they are added directly to the Windows embedded frame
> (WEmbeddedFrame). This problem only happens on Windows, and t is
> possible to work around it by adding a java.awt.Panel between them.
> Here is the bug report if you want to take a look:
>         https://bugs.eclipse.org/bugs/show_bug.cgi?id=50034
> Thanks!
> Silenio

I have created a testcase for this problem. Simply unzip the attached testcase
and run in on windows with SWT 3.0 M6 or above. The problem only occurs on windows. The firstr example AWTInSWT_Frame does not work, AWTInSWT_Panel does.
###@###.### 10/6/04 14:46 GMT

EVALUATION Works with JDK 7.

EVALUATION Name: osR10079 Date: 01/23/2004 The cause of the problem is that EmbeddedFrame doesn't have LightweightDispatcher associated with it. This dispatcher should redirect events to ligthweights inside heavyweight container. The dispatcher should be created in addNotify(), but we do not call this method on EmbeddedFrame because we create its peer in its ctor. I've verified that if user call addNotify() on embedded frame then the test works correct. The fact that EmbeddedFrame doesn't have LightweightDispatcher doesn't break plug-in because it always add heavyweight panel in embedded frame and this panel has its own dispatcher. I think it's too late for tiger, but in thext release we should investigate if calling of addNotify() on EmbeddedFrame won't cause regression. For now direct call of addNotify() may be used as workaround. ###@###.### Jan 23, 2004 ====================================================================== Unfortunately, we have to postpone this issue to dolphin. ###@###.### 2005-06-16 14:05:45 GMT

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang

WORK AROUND The workaround is to insert a panel in between the embedding frame and lw cxomponents.