Java-使Java程序在网页上运行 [英] Java - Make a java program run on a webpage

查看:377
本文介绍了Java-使Java程序在网页上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我如何使Java程序在网页上运行吗?我知道现在有很多浏览器不支持Java带来安全风险,但是我使用的是Java 6之类的旧Java版本.

Does anyone know how I can make a java program run on a webpage? I know many browsers now days do not support Java for security risk, but say I was using an older Java version like Java 6.

我要怎么做才能使其在网页上运行?当然,只要用户单击按钮,就说允许"或运行程序"是可以的.我不能为此使用Javascript.

What would I have to do to get it to run on a webpage? Of course saying "Allow" or "Run Program" whenever the user clicks a button is alright. I cannot use Javascript for this.

谢谢

推荐答案

除Applets之外,另一个选择是 Java Web Start :

Another option, apart from Applets, is Java Web Start:

Java Web Start软件提供了启动功能全面的功能只需单击一下应用程序.用户可以下载并启动应用程序,例如完整的电子表格程序或Internet聊天客户端,而无需执行冗长的安装过程.

Java Web Start software provides the power to launch full-featured applications with a single click. Users can download and launch applications, such as a complete spreadsheet program or an Internet chat client, without going through lengthy installation procedures.

使用Java Web Start软件,用户可以通过以下方式启动Java应用程序:点击网页上的链接.链接指向Java网络启动协议(JNLP)文件,用于指示Java Web Start软件下载,缓存和运行应用程序.

With Java Web Start software, users can launch a Java application by clicking a link in a web page. The link points to a Java Network Launch Protocol (JNLP) file, which instructs Java Web Start software to download, cache, and run the application.

如果您打算做一些非常消耗CPU的事情,最好使用Java Web Start.但是,如果需要一些JavaScript和Java交互,最好使用旧的Applet.

If you are planning to do something very CPU consuming is better to use Java Web Start. But if you need some JavaScript And Java interaction it would be better to use the old Applets.

如果您担心浏览器阻塞或不支持Java Applet,那么Java Web Start还是一个更好的选择.

If you are worried about browsers blocking or not supporting Java Applets, then Java Web Start is again a better option.

您可能会感兴趣以下链接:

The following links may be of interest to you:

这篇关于Java-使Java程序在网页上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆