简体   繁体   中英

How do I load and display a remote jar applet in my applet?

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?

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..).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM