tags:

views:

124

answers:

1

I would like to load remote applets into my own applet.

For example, lets say I want my applet to download and display a game from this site within my java applet:

http://www.java4k.com/index.php?action=home

How do I do that?

+2  A: 

You can use a signed applet to access the local file system and bypass the same-origin policy.

The LWJGL java library has developed an "applet loader" you can modify and reuse. http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/applet

Here is an example use in the wild: http://www.paulscode.com/demos/SoundSystem/09AUG2009/Helicopter.html

Basically, the applet_loader downloads a bunch of file, write them on the disk, add them to the classpath, instantiate the target applet, and then proxies Java methods call on it to the target applet (Applet.start, Applet.stop, etc..).

Mathieu Ravaux