LIfe cycle of applet

Life cycle of applet


Here i have provided information about applet what is an applet , what it means, about the working of applet ...

Then also lets quick revise about applet ... 

AN applet is basically a background on which we can keep tools ,controls etc...working for browser application or web page ..

Also provided information about how an applet works just import the package java.applet around made any class give the name which you would like to give and extend Applet compile the java file and write applet tag as mentioned in the earlier post and RUN in either browser or an appletviewer provided by JDK.

This was the quick revision i gave to make an applet that is just a white back ground that would appear on your screen .

NOW about the life cycle of an applet while just as we have seen the life cycle of thread lets take a quick look on the life cycle of an applet .

First of all the life cycle is divided into 5 phase mainly these all are the methods registered when we perform certain actions on an Applet

1) init()
2)start()
3)stop()
4)destroy()
5)paint()

NOW just as we give the comand for appletviewer besides writing a java file name Applet starts to initialize so that we can say applet is born or the satrting point of the applet.tivated 

Second is start()-----> it comes to picture when an applet is activated or when we  maximize the applet . Activated means we are moving a mouse or clicking on the window of applet to make that activate for eg the blue highlight we see when we click on the window and at the back becomes a dull blue that portion is known as deactivated so start comes into picture when we do two things either we activate by clicking or we maximize the window

Third is stop()-----> opposite of start, comes into picture when we minimize the window or we deactivate the window by clicking elsewhere other than the applet.

Fourth one is destroy()----->the name  itself suggest that when we close the applet destroy is called .

Fitfth one is paint(Graphics g)----->here as an argument we have object of Graphics class it is called when we maximize minimize activate or deactivate in all states, presence of paint is there for sure .


This was all about the life cycle of thread hope might have enjoyed by reading it...!!


Comments

Popular posts from this blog

State space search / blocks world problem by heuristic approach /TIC TAC TOE

Navigation in Vaadin.

Drag and drop items from one Grid to another