·  JAVA – Application Type – Applet

 

- Info:

  - This tutorial shows how to create Applet.

  - Applet is JAVA program ment to run under Web Browser.

 

- Example:

  - Create JAVA Console Application Test.java

  - Create Web Page D:\Temp\Test.html

 

    Test.java

    import java.applet.*;

    import java.awt.*;

     

    public class Test extends Applet {

      public void paint(Graphics g) {

        g.drawString("Hello world!", 50, 25);

      }

    }

   

    Test.html

    <html>

      <body>

        Here is the output of my program:

        <applet code="Test.class" width="150" height="25" alt=""></applet>

      </body>

    </html>

 

- Test:

  - D:\Temp\Test.html