title: Debug/Run Applet in NetBeans
body: <p>How can I debug or run a class that extends <code>java.applet.Applet</code>? I am able to run the applet from the command line with appletviewer. </p>
  
  <pre><code>appletviewer runapp.html
  </code></pre>
  
  <p>Here is what class looks like:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.awt.Graphics;
  import java.applet.Applet;
  
  public class FancyApplet extends Applet {
      @Override
      public void paint(Graphics g) {
          g.drawString("Hello World!", 20, 20);
      }
  }
  </code></pre>
  
  <p>Here is what the HTML file looks like</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;A Fancy Applet&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;object type="application/java" width="200" height="300"&gt;
      &lt;param name="code" value="FancyApplet.class"&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>How do I have to organize those files within my project and what settings do I have to use to debug the Applet in NetBeans? The thread <a href="https://stackoverflow.com/questions/7054382/running-a-java-applet-from-netbeans">Running a java applet from netbeans?</a> did not help unfortunately. I did what was suggested, but get a message telling me that the main class was not found. What I took from it though was that in my case the HTML file is not even needed? But just because I am curious is it still possible or recommended to use it?</p>