GUI=graphical user
interface
Applet programming
We
can create web application using applet
/* this is Lifecycle of applet
program
Save this file Lifecycle.java/*
import java.applet.*;
import
java.awt.Color;
import java.awt.Font;
import
java.awt.Graphics;
public class
Lifecycle1 extends Applet
{
Font f;
{
f=new Font("courier
New",Font.BOLD,50);
setFont(f);
System.out.println("Initialization of
applet..");
setBackground(Color.red);
setForeground(Color.white);
}
public void start()
{
System.out.println("Starting of
applet..");
}
public void stop()
{
System.out.println("Stoping of
applet..");
}
public void destroy()
{
System.err.println("Destroying of
applet..");
}
public void paint(Graphics g)
{
g.drawString("Welcome in GUI
programing",100,100);
g.drawLine(100,0,0,0);
}
}
/*
<applet
code=Lifecycle1 height="300" width="300"></applet>
*/
Run pogram :
11. Open cmd
22. Compile the pogram: javac
Lifecycle.java
33. Run pogram: appletviewer
Lifecycle.java