In java they are two ways of programming.
1.Application.
2.Applet.
Applet:
Applet can run in the internet browser.
Here it doesnt requires the main() (i.e public static void main(String args[]).
basic applet:
1) Import necessary package.
import java.applet.*;
import java.awt.*;
2) public class Applet1 extends Applet{ /** Creates a new instance of Applet1 */ public Applet1() { }
3) // inserting the html code with applet at the first time.. public void init() { } 4) // this method called wen the enter the html everytime wit applet. public void start() { } //destory the page... 5) public void stop() { } // need to paint in applet... //overides the method.. 6) public void paint(Graphics g) { }
}
|