APPLETS : NEENU PRASAD APPLETS
applets : applets Small java programs used in internet computing Event driven programs Window based programs Applets have limited access to clients resources. Runs on appletviewer or java enabled web browsers
When to use applets : When to use applets dynamic content is needed in web pages Flash contents or output like sounds,animations etc needed while displaying web pages. Need to create a program to be used by others and make it available on internet.
Difference with application programs : Difference with application programs Small programs Do not use main() method to start execution Cannot run independently Can run any program on local computer Accessing local data is strictly restricted. Cannot communicate with servers on other networks
Applet lifecycle : Applet lifecycle init() Born state Running state Idle state Dead state Start() Stop() Start() destroy() paint()
Applet skeleton : Applet skeleton 4 methods Init():applet enters born state Start():enters to running state Stop():enters to idle state Destroy():enters to dead state Paint():for display
Cont… : Cont… Import java.awt.*; Import java.applet .*; /* */ Public class Appletskel extends applet { Public void init() { // initialisation } Public void start() { //start or resume execution }
Con… : Con… Public void stop() { //suspends execution } Public void destroy() { //performs shutdown activities } Public void paint(Graphics g) { //display contents of window }
PowerPoint Presentation : THANK YOU