Related differences

Ques 6. What are the Applets Life Cycle methods? Explain them?

methods in the life cycle of an Applet: 

  • init( ) method - called when an applet is first loaded. This method is called only once in the entire cycle of an applet. This method usually intialize the variables to be used in the applet.
  • start( ) method - called each time an applet is started.
  • paint( ) method - called when the applet is minimized or refreshed. This method is used for drawing different strings, figures, and images on the applet window.
  • stop( ) method - called when the browser moves off the applet's page.
  • destroy( ) method - called when the browser is finished with the applet.

Is it helpful? Add Comment View Comments
 

Ques 7. What is the sequence for calling the methods by AWT for applets?

When an applet begins, the AWT calls the following methods, in this sequence:

  1. init()
  2. start()
  3. paint() 

When an applet is terminated, the following sequence of method calls takes place:

  1. stop()
  2. destroy()

Is it helpful? Add Comment View Comments
 

Ques 8. How do Applets differ from Applications?

Following are the main differences:

Application: Stand Alone, doesn't need web-browser.

Applet: Needs no explicit installation on local machine. Can be transferred through Internet on to the local machine and may run as part of web-browser.

Application: Execution starts with main() method. Doesn't work if main is not there.

Applet: Execution starts with init() method.

Application: May or may not be a GUI.

Applet: Must run within a GUI (Using AWT). This is essential feature of applets.

Is it helpful? Add Comment View Comments
 

Ques 9. Can we pass parameters to an applet from HTML page to an applet? How?

We can pass parameters to an applet usingtag in the following way:

  • <param name="param1″ value="value1″>
  • <param name="param2″ value="value2″>

Access those parameters inside the applet is done by calling getParameter() method inside the applet. Note that getParameter() method returns String value corresponding to the parameter name.

Is it helpful? Add Comment View Comments
 

Ques 10. In our URLs and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?

Since 2.00 version our applets support an user-defined delimiter for the menu arguments. To modify the default delimiter add the following parameter (you can use any character as a delimiter):

<param name="delimiter" value="~"> and use it within "menuItems":

<param name="menuItems" value=" {Home~http://www.withoutbook.com/index.php} {Features, Setup~http://www.globalguideline.com/} ">

Is it helpful? Add Comment View Comments
 

Most helpful rated by users: