Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT_AWT Bridge for Applet?
SWT_AWT Bridge for Applet? [message #445349] Wed, 03 November 2004 16:23 Go to next message
Greg Roberts is currently offline Greg RobertsFriend
Messages: 88
Registered: July 2009
Member
I am using the SWT_AWT bridge so that I can embed an Applet inside of an
Eclipse view.
I have a class that creates an applet instance and inside of my
createPartControl method for the view I create the bridge and add this
applet instance, etc.
However, whenever I open the view the applet instance is created and runs
outside of the view. The view is empty and the applet is running on its
own in its own frame.

Any idea what might be happening here.

Here is code from my createPartControl where I create the bridge:

public void createPartControl(Composite parent) {

Composite appletComp = new Composite(parent, SWT.EMBEDDED);
appletFrame = SWT_AWT.new_Frame(appletComp);

java.awt.EventQueue.invokeLater(
new Runnable() {
public void run() {

TestApplet appletInstance = new TestApplet();
appletInstance.init();

Panel appPanel = new Panel(new BorderLayout());
appPanel.add(appletInstance);
appletFrame.add(appPanel);
appletFrame.paintAll(appletFrame.getGraphics());
}
}
);
}


TestApplet is just an inner class that calls out to another class that is
basically an applet container that creates the instance of the applet.

Thank you.
Re: SWT_AWT Bridge for Applet? [message #445389 is a reply to message #445349] Thu, 04 November 2004 19:02 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
What applet viewer are you using for this? The entire applet viewer must be
embedded in appletComp.

"Greg " <gwrobert@us.ibm.com> wrote in message
news:cmb0mf$bbd$1@eclipse.org...
>I am using the SWT_AWT bridge so that I can embed an Applet inside of an
>Eclipse view.
> I have a class that creates an applet instance and inside of my
> createPartControl method for the view I create the bridge and add this
> applet instance, etc. However, whenever I open the view the applet
> instance is created and runs outside of the view. The view is empty and
> the applet is running on its own in its own frame.
>
> Any idea what might be happening here.
>
> Here is code from my createPartControl where I create the bridge:
>
> public void createPartControl(Composite parent) {
>
> Composite appletComp = new Composite(parent, SWT.EMBEDDED);
> appletFrame = SWT_AWT.new_Frame(appletComp);
>
> java.awt.EventQueue.invokeLater(
> new Runnable() {
> public void run() {
> TestApplet appletInstance = new TestApplet();
> appletInstance.init();
> Panel appPanel = new Panel(new BorderLayout());
> appPanel.add(appletInstance);
> appletFrame.add(appPanel);
> appletFrame.paintAll(appletFrame.getGraphics());
> }
> }
> );
> }
>
>
> TestApplet is just an inner class that calls out to another class that is
> basically an applet container that creates the instance of the applet.
> Thank you.
>
Previous Topic:Layout in Group not working properly
Next Topic:Controling the CLOSE decoration on a Shell
Goto Forum:
  


Current Time: Thu Apr 25 14:59:30 GMT 2024

Powered by FUDForum. Page generated in 0.02488 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top