title: How do I package up an applet with multiple .jar libraries?
body: <p>I'm creating a Java applet from a large scale pre-existing project (Vizster). I am using NetBeans 6.7.1 with JDK 1.5 on Mac OS X. </p>
  
  <p>I am attempting to run the applet from it's single output .jar file, but when I do this, it says "applet loaded" at the bottom of screen in Firefox, and there is nothing in the java console, but nothing shows up in the window for the applet. I have had different errors in Firefox previous to this, including errors such as "appletNotLoaded:ClassDefNotFoundError" and also security errors, but there is never any output in my java console. Here is the html file for the applet:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
   &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;applet codebase ="." code="zuve.ZuveApplet.class"
              archive="ZuveApplet.jar"
              height="1000" width="1000"/&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Where zuve.ZuveApplet.class is where my main method is located, and "ZuveApplet.jar" is the name of the output jar file. Here is ZuveApplet.java, the main method class:</p>
  
  <pre><code>package zuve;
  
  import vizster.Vizster;
  import vizster.VizsterLib;
  import java.applet.Applet;
  
   public class ZuveApplet extends Applet {
       public static final String DEFAULT_START_UID = "186297";
  
       @Override
       public void init() {
          new Vizster();
       }
  
      public static void main(String[] argv) {
          VizsterLib.setLookAndFeel();
          //String startUID = argv.length &gt; 0 ? argv[0] : DEFAULT_START_UID;
          String startUID = DEFAULT_START_UID;
          String file = argv.length &gt; 0 ? argv[0] : null;
          new Vizster(startUID, file);
      }
   }
  </code></pre>
  
  <p>The applet runs perfectly well as a standalone (not embedded in html), but I need to embed it. The "Vizster" object is an extension of a JFrame, so I figure I should just be able to create an instance of it and add it to an applet. Might it be much more complicated than this?</p>
  
  <p>I'm new to java and applets in general unfortunately. I have seen a lot of forum posts about source tree structure being an issue, so:</p>
  
  <p>1)is it a problem that I am using multiple packages? They are all in the src directory of my project. </p>
  
  <p>2)is there anything I need to be placing in my java home directory? I know a lot of people have classpath issues, but I am using a modern IDE which I thought took care of all that for me. </p>
  
  <p>3)when importing my project into a NetBeans Java Web Application project, should I be adding the applet to the project as a .jar, or should I add the whole project?</p>
  
  <p>4)Originally when I had created this applet, I just had my few source files and a bunch of .jar libraries as dependencies, but when I inspected the output .jar, all I saw were the compiled source files. There was no trace of the files from the libraries. Is this how it should be? I noticed that if I moved the output .jar from its containing folder, it could no longer run standalone. I thought that .jars were supposed to be self contained, is this not true? Is there anything I should know about making an <em>executable</em> jar?</p>
  
  <p>5)on a side note, does the size of the applet denoted in the applet tags in the html have to exactly match the size of the applet itself?</p>
  
  <p>Sorry for the enormous post, and the incredibly vague problem, I am working with a team in which nobody knows anything about applets or Java (real brilliant of us, I know). Any sort of help or general suggestions would really help.</p>
  
  <p>Thank you!</p>