title: Java Applet Embed Issues
body: <p>I've been stuck with this for ages now, and none of the content I could find on the web has been much use. I've built a Java Applet that works 100% with no errors in Eclipse's Applet Viewer. I've exported it as a jar and allowed the web address through as an Exception Site in Java Config.</p>
  
  <p>When I embed the applet in HTML though, it doesn't work, a NullPointerException every time, and the Java Console shows nothing.</p>
  
  <p>My embed code:</p>
  
  <pre><code>&lt;object type="application/x-java-applet" width="800" height="600"&gt;
      &lt;param name="codebase" value="." /&gt;
      &lt;param name="code" value="appletpackage.Main" /&gt;
      &lt;param name="archive" value="Applet.jar" /&gt;
      &lt;param name="scriptable" value="true" /&gt;
      &lt;param name="mayscript" value="true" /&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>My Applet <code>init()</code>:</p>
  
  <pre><code>public void init() {
      setSize(800, 600);
      obstGen = new ObstacleGenerator(100, getWidth(), getHeight() - 256);
      setBackground(new Color(112, 199, 255));
      setFocusable(true);
      addKeyListener(this);
      try {
          base = getDocumentBase();
          character = getImage(base, "data/putinstill.png");
          background = getImage(base, "data/putinbg.png");
          towers = getImage(base, "data/towerbg.png");
          putindown = getImage(base, "data/putindown.png");
          exclaim = getImage(base, "data/exclaim.png");
          obst1 = getImage(base, "data/obst1.png");
      } catch (Exception e) {
          // TODO: handle exception
      }
  }
  </code></pre>
  
  <p>Anyone got ideas?</p>