简体   繁体   中英

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

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

<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">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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