如何在 Web 浏览器中运行 Java 小程序 [英] how to run a java applet in web browser

查看:48
本文介绍了如何在 Web 浏览器中运行 Java 小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 java SE 项目,或者你可以说 applet,但我想在网络浏览器中运行这个小程序,这怎么可能?

I have a java SE project or you can say applet, but i want to run this applet in web browser how is it possible?

我需要复制 jar 文件,就像我开始知道的那样,但可能的解决方案是什么?

I need to copy jar file something like this i came to know but what is the possible solution?

推荐答案

本教程几乎涵盖了从编写您的小程序以将其嵌入您的网页.如果您已经完成了小程序,看起来,向下滚动到调用小程序".以下是教程中的代码,可提供快速解决方案:

This tutorial pretty much covers everything from writing your applet to embedding it on your web page. If you already have your applet done, as it seems, scroll down to "Invoking an applet". Here's the code from the tutorial for a quick solution:

<html>
<title>The Hello, World Applet</title>
<hr>
<applet code="HelloWorldApplet.class" width="320" height="120">
If your browser was Java-enabled, a "Hello, World"
message would appear here.
</applet>
<hr>
</html>

这篇关于如何在 Web 浏览器中运行 Java 小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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