Java Applet by Example 

  • Okay, we still have a few more things to talk about before you actually build your own applet. However, I will introduce a simple applet so you can see what it would look like. Notice that we have to import the applet package. 
  • import java.awt.*;
    import java.applet.*;
    
    public class Hello extends Applet
      {
      public void init()
        {
        System.out.println("We have been initialized");
        }
    
      public void start()
        {
        System.out.println("We have been started");
        }
    
      public void stop()
        {
        System.out.println("We have been stopped");
        }
    
      public void destroy()
        {
        System.out.println("We have been destroyed");
        }
    
      }

Additional Resources:

Applet Lifecycle
Table of Contents
Applet HTML


Graphics & Media Lab. >> Библиотека | Курсы | Графикон

Hosted by Graphics & Media Lab
http://graphics.cs.msu.su
lab_logo
mailto: Laboratory