title: runtime problem with second example of HelloWorldApplet
body: <p>I'm following the course "Teach Yourself Java in 21 Days"
  (<a href="https://www.cs.cmu.edu/afs/cs.cmu.edu/user/gchen/www/download/java/LearnJava.pdf" rel="nofollow noreferrer">https://www.cs.cmu.edu/afs/cs.cmu.edu/user/gchen/www/download/java/LearnJava.pdf</a>)</p>
  
  <p>I have a problem with the second example:</p>
  
  <pre><code>import java.awt.Graphics;
  
  
  class HelloWorldApplet extends java.applet.Applet {
  
      public void paint(Graphics g) { 
      g.drawString("Hello world!", 5, 25);
      }
  }
  </code></pre>
  
  <p>The compiling of this Java code generates 2 warnings:</p>
  
  <pre><code>warning: [serial] serializable class HelloWorldApplet has no definition of serialVersionUID
  class HelloWorldApplet extends java.applet.Applet {
  ^
  2 warnings
  </code></pre>
  
  <p>When I execute this code with</p>
  
  <pre><code>java HelloWorldApplet 
  </code></pre>
  
  <p>I get  </p>
  
  <pre><code>Error: Main method not found in class HelloWorldApplet, please define the main method as:
  public static void main(String[] args)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>a JavaFX application class must extend javafx.application.Application 
  </code></pre>