Drag and drop between AWT and SWT? [message #163988] |
Sat, 15 January 2005 00:43 |
Eclipse User |
|
|
|
Originally posted by: kevinlouisnospam.hotmail.com
I am new to SWT. As far as I know, the mechanism of the DND between AWT and
SWT are totoally different. Is there any way or bridge to make them working
together.
I have an existing component written in AWT and I need to write a new
component in SWT. I want to drag from the AWT to SWT without rewritting the
old one.
Thanks in advance.
|
|
|
|
Re: Drag and drop between AWT and SWT? [message #164335 is a reply to message #164021] |
Tue, 18 January 2005 17:15 |
Eclipse User |
|
|
|
Originally posted by: kevinlouisnospam.hotmail.com
Thanks for your reply. I know there is SWT_AWT bridge. I have tried putting
AWT components in the SWT, the DND between the AWT components work. But I
don't know how to get the drop event in SWT from the dragging in AWT. The
DND between AWT and SWT are using Transferable and Transfer to transfer the
data. Do you think the DND works between them?
Thanks,
Kevin
"francois GRUYER" <gruyer.francois@wanadoo.fr> wrote in message
news:csebep$v43$1@www.eclipse.org...
> Kevin,
>
> Have a look to code: org.eclipse.swt.internal.SWT_AWT.
>
> This offers support to embed an AWT/SWING component into a SWT composite.
>
> (Use SWT+Eclipse 3.0 only , I think this would not exist yet in 2.1).
>
> To embed your AWT component:
>
> Create a SWT composite in your display shell, using style SWT.EMBEDDED.
>
> Create an AWT Panel (for example) to host the AWT component. Creation
method
> is something such as:
>
> Panel myPanel = SWT_AWT.new_Panel(Composite);
>
> Put your AWR component in the panel:
>
> myPanel.add(myAWTComponent);
>
> Regards
>
> Francois GRUYER
>
> "Kevin" <kevinlouisnospam@hotmail.com> a
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01546 seconds