简体   繁体   中英

How to build a java applet?

Most of the tutorials around explain how to create a java applet: create a .java file with a class, compile it with javac, put the .class somewhere, add a proper tag in the html.

However, I'm not able to find anything about the best practices to build and release a complex applet, made of multiple classes and with additional libraries. How is the build/release process for this case ? What is it needed to go from my java project to the final .jar to put on the web ?

I'm working with pure Eclipse, no plugins.

If you are starting a new project, do not use Applets. Applets are an old technology.

There is many new ways to replace Applets, try Java Web Start for example, here is a tutorial on how to start JWS

UPDATE
After your comment, here is how to deploy a packaged applet:
In Eclipse, create your full application usually, with at least one Applet class, lets say the full path to this class is org.test.appletproject.MyApplet , when done, from Eclipse, make Export->Jar .

Now in the HTML page, use this tag:

<applet code = 'org.test.appletproject.MyApplet' 
      archive = 'AppletProject.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