secretofreading(Stay Tuned To My Blog For More Updates!!!)(Blog is for sale any one want to buy just fill out the contact form...

Saturday, 8 June 2013

Applets

APPLETS
=======
Applet:-
   An Applet represents java Bytecode embeded in a Web page.

Uses of Applet:-
==============
1.Applets are used to provide the dynamic nature to the webpages.
2.Applets are used in Animations and games development.

TO CREATE AN APPLET:-
--------------------
  The following methods should be used:-
  These methods are available in java.applet.Applet and     javax.swing.JApplet classes.
1.public void init():-  (To Initialize)
This method is executed only once, immediately after the  applet is loaded into memory.We write code to initialize the variables, parameters, to create the components etc...,

2.public void start():-
This method is executed after init method.It is executed as long as applet receives focus.
We write code to connect to data bases,retrieve data process the data and display the results.
therefore start() method is heart of applet.

3.public void stop():-
   This method is executed when an applet loses its focus.
   We write code to disconnect from the data bases,stop    the running threads and perform cleanup operations.

   Note:- start() and stop() methods can be executed             repeatedly.

4.public void destroy():-
    This method is executed when the applet is terminated     from the memory.
    We write code related to the task after terminating     the applet should be written in this method.

  Note:- stop() method is always executed just before               destroy() method

IIQ) What is applet lifecycle?
r)    see above.

Note:-
  public void paint(Graphics g) method can also be used   in applets.

Note:- There is no public static void main(String args[])        method available in applets.

IIQ)Where applets are executed?
r) Applets are executed by applet engine(JVM) present in the     web browser on the client Machine.

->Html is a text formatting language.It uses tags to formate the text.

->Tag:- A tag is a string constant that formats the text.

<applet> : To embed an applet into webpage.

No comments:

Post a Comment