Top
Previous Next
Interfaces, GUIs, and Applets CS 161 - Java

Applets

Java code run by a browser must be an applet, not an application.
  • The browser JVM expects the class mentioned in the web page to
    extend java.applet.Applet
    

  • java.applet.Applet has four methods the browser calls to control the applet:

    These are referred to as the applet life-cycle methods

  • The applet class does not have a main method; if it has one it is ignored by the browser.

  • Instead of starting with the class's main method, browser JVM's start by calling the referenced applet's init method.

  • As bytecodes in the currently executing class reference other Java classes, those classes are downloaded or accessed, and the JVM executes them.


  • Top
    Previous Next
    jwd