简体   繁体   English

如何在小程序中加载和显示远程jar小程序?

[英]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 : 例如,假设我希望我的applet从我的java applet中的该站点下载并显示游戏:

http://www.java4k.com/index.php?action=home 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. LWJGL Java库已经开发了可以修改和重用的“小程序加载器”。 http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/applet 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 以下是野外使用的示例: 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..). 基本上,applet_loader下载一堆文件,将它们写入磁盘,将它们添加到类路径,实例化目标applet,然后代理Java方法将其调用到目标applet(Applet.start,Applet.stop等)。 )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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