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 workin开发者_运维技巧g 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 />
精彩评论