United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4982522 : SWT/AWT embedding Frame does not get Mouse events on Windows.

Details
Type:
Bug
Submit Date:
2004-01-23
Status:
Closed
Updated Date:
2009-06-15
Project Name:
JDK
Resolved Date:
2009-06-15
Component:
client-libs
OS:
windows_xp
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Cannot Reproduce
Affected Versions:
6
Fixed Versions:
7

Related Reports

Sub Tasks

Description
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

                                    

Comments
EVALUATION

Works with JDK 7.
                                     
2009-06-15
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
                                     
2005-06-16
WORK AROUND

The workaround is to insert a panel in between the embedding frame and lw cxomponents.
                                     
2004-08-18
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-08-18



Hardware and Software, Engineered to Work Together