How do I package up an applet with multiple .jar libraries?

牧云@^-^@ 提交于 2019-11-30 09:03:10
Devon_C_Miller

You can specify multiple jars in the archive attribute:

<applet codebase ="." code="zuve.ZuveApplet.class"
        archive="ZuveApplet.jar,thing.jar,anotherThing.jar"
        height="1000" width="1000"/>

A JFrame is a top-level container, so you won't be able to add it to your applet. You can have your applet create an instance of your object and let it open its own window. A more flexible approach would be to refactor your object into a JPanel. As a JPanel, it can be added to a JApplet, or to a JFrame if you also want to support running it as an application.

Also take a look at JNLP as that lets you deploy your code as an applet or as an application and also provides APIs for printing and local file access. Functionality not available to simple applets.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!