Basic Java Applet Example

/*
Basic Java Applet Example
 This Java example shows how to create a basic applet using Java Applet class.
 */
 import java.applet.Applet;
 import java.awt.Graphics;
 /*
 <applet code = "BasicAppletExample" width = 200 height = 200>
 </applet>
 */
 public class BasicAppletExample extends Applet{
 public void paint(Graphics g){
 //write text using drawString method of Graphics class
 g.drawString("This is my First Applet",20,100);
 }
 }



Comments

Popular posts from this blog

Life Cycle of an Applet:

How to use for and foreach loops to display elements of an array.

The Applet CLASS: