HOME - TOC - 1 - 2 - 3 - 4 - 5 
Lesson 01   Hello World
 
  [ Hello World ]

In this tutorial you will learn how to write a simple "Hello World" applet.



[ Code ]

//  Lesson01
//  Hello World
//  This code is better viewed with tab size=4

import java.applet.Applet;
import java.awt.*;

public class Lesson01 extends Applet
{
  Color  txtColor;  // Text color

  public void init()
  {
    txtColor = Color.black;
  }

  public void start()
  {
  }

  public void stop()
  {
  }

  public void destroy()
  {
  }

  public void paint(Graphics g)
  {
    g.setColor(txtColor);
    g.drawString("Lesson01",10,20);
    g.drawString("Hello World",10,35);
  }

  public void update(Graphics g)
  {
  }

}

[ HTML TAG ]


<applet code="Lesson01.class" codebase="lesson01" width="100" height="50">
</applet>


[ Source ]

- Lesson.java

HOME - TOC - 1 - 2 - 3 - 4 - 5