Friday, March 5, 2010

Java Applets

Applet is different from a typical Java application where it has to work with the Java environment itself. On the other hand, applet must work within another application like an HTML page. Thus, it requires a browser. 

The class name must be the compiled Java program. They are to be of the same location to work. Do check  the needed Java program below.

[+/-] show/hide

import java.applet.*;
import javax.swing.*;

public class AppletGreet1 extends Applet {
JLabel greeting = new JLabel("Hello world");

public void init()