title: How do I run Java applets from Command Prompt?
body: <p>So a little background that may answer some questions on why I'm asking this. I took a java programming class my freshman year in high school, then I stopped. I'm trying to pick it up again, but I forgot almost everything. I still have some of the old programs I saved and I'm trying to get some of them working, but I can't get this one working (I'm pretty sure it was working on the school computers, but I can't remember).</p>
  
  <pre><code>import javax.swing.JApplet;
  import java.awt.*;
  //import java.applet.applet;
  
  public class PP2_14 extends JApplet
  {
      public void paint (Graphics page)
      {
          final int MID = 150;
          final int TOP = 50;
  
          setBackground (Color.cyan);
  
          page.setColor (Color.blue);
          page.fillRect (0, 175, 300, 50); //ground
  
          page.setColor (Color.yellow);
          page.fillOval (-40, -40, 80, 80); //sun
  
          page.setColor (Color.white);
          page.fillOval (MID-20, TOP, 40, 40); //head
          page.fillOval (MID-35, TOP+35, 70, 50); //upper torso
          page.fillOval (MID-50, TOP+80, 100, 60); //lower torso
  
          page.setColor (Color.black);
          page.fillOval (MID-10, TOP+10, 5, 5); //left eye
          page.fillOval (MID+5, TOP+10, 5, 5); //right eye
  
          page.drawArc (MID-10, TOP+20, 20, 10, 190, 160); // smile, change to frown and make this not a frown
  
          page.drawLine (MID-25, TOP+60, MID-50, TOP+40); //left arm
          page.drawLine (MID+25, TOP+60, MID+55, TOP+60); //right arm
  
          page.drawLine (MID-20, TOP+5, MID+20, TOP+5); //brim of hat
          page.fillRect (MID-15, TOP-20, 30, 25); //top of hat
      }
  }
  </code></pre>
  
  <p>This compiles fine, but it won't run. I figured that i need to insert "public static void main(String[] args)" somewhere, and that's what command prompt tells me, but I don't know where.
  I have tried putting it after</p>
  
  <pre><code>public class PP2_14 extends JApplet {
  </code></pre>
  
  <p>and after</p>
  
  <pre><code>public void paint (Graphics page) {
  </code></pre>
  
  <p>but neither works. Where should I put the main method? Is there something else I'm doing wrong? Thanks for your time.</p>