简体   繁体   English

如何将加工草图作为JAVA小程序放置在我的网站上?

[英]How can I put a processing sketch on my website as a a JAVA applet?

I have a game with external files and libraries which was made in processing. 我有一个带有外部文件和库的游戏,该文件是在处理过程中制作的。 I want to put this on my webpage as an embeded java applet (not javascript) and I can't find a way to this. 我想将其作为嵌入的Java applet(不是javascript)放在我的网页上,但我找不到解决方法。 Is it possible? 可能吗? If so, how? 如果是这样,怎么办? Thank you. 谢谢。

Java applets are dead. Java applet已死。 Most browsers have removed support for them, and Java deprecated them in Java 9. 大多数浏览器已删除了对它们的支持,而Java在Java 9中已弃用它们。

You could use Java Web Start , which basically puts a button on your webpage that launches a Java .jar file. 可以使用Java Web Start ,它基本上是在您的网页上放置一个按钮来启动Java .jar文件。 But note that you'll still have to sign your application with a paid certificate. 但是请注意,您仍然必须使用付费证书对应用程序进行签名。 Your users will also have to have Java installed and correctly configured. 您的用户还必须安装Java并正确配置。 This is a pretty far cry from what most users expect (a simple application that is embedded in the page). 这与大多数用户的期望(页面中嵌入的一个简单应用程序)相去甚远。

You're probably better off packaging your sketch as a runnable executable. 您最好将草图打包为可运行的可执行文件。 You can do that from the Processing editor, or there are tools out there that package it for you. 您可以从“处理”编辑器中执行此操作,也可以使用一些工具将其打包。 Shameless self-promotion: here is a tutorial on exporting Processing sketches as executables. 无耻的自我宣传: 是有关将处理草图导出为可执行文件的教程。

But your best option is to deploy as JavaScript using Processing.js or rewrite your sketch in P5.js . 但是最好的选择是使用Processing.js部署为JavaScript或在P5.js中重写您的草图。 Then you can deploy your sketch as JavaScript and embed it directly in a webpage. 然后,您可以将草图部署为JavaScript,并将其直接嵌入到网页中。

There is a tool, to be installed from the "tools" menu called "Applet Maker" by Peter Lager that just do this. 有一个工具可以从Peter Lager的“工具”菜单(称为“ Applet Maker”)中安装。 Go to "tools" > "add tool" and install it. 转到“工具”>“添加工具”并进行安装。 Then with the sketch opened chose "tools" > "Applet Exporter and Signer". 然后打开草图,选择“工具”>“ Applet导出器和签名器”。 The interface is quite self explanatory. 该界面很容易说明。

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

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