简体   繁体   English

将小程序放在日食中

[英]Put an applet in eclipse

I have made an applet in eclipse, and I can run it succesfully with right click on the java file and run as -> Java Applet 我已经在eclipse中创建了一个applet,并且可以通过右键单击java文件并以-> Java Applet的方式成功运行它

But I want to add that applet into a xhtml file, so added the applet tag in the index.xhtml file but when I deploy the index.xhtml in the browser I just get an error saying that the MyApplet.class cannot be found 但是我想将该小程序添加到xhtml文件中,所以在index.xhtml文件中添加了小程序标签,但是当我在浏览器中部署index.xhtml时,我得到一个错误,提示找不到MyApplet.class

<applet code="com.project.helper.MyApplet.class" width="500" height="500">

I have the files organized in this way: 我以这种方式组织了文件:

Image with the body of the files 带有文件主体的图像

您必须定义applet xhtml行的archive属性,这是应从中加载class属性的applet jar文件的位置。

<applet code="com.project.helper.MyApplet.class" archive="MyApplet.jar" width="500" height="500">

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

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