Doubt on using Threads / applets


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Doubt on using Threads / applets

  1. #1
    Pavan Guest

    Doubt on using Threads / applets


    Hi,
    Would like if someone gave a basic explanation of how
    to use start(), init(), stop() methods in an applet.

    Thanx
    Pavan


  2. #2
    John Timney (MVP) Guest

    Re: Doubt on using Threads / applets

    get a copy of thinking in java from the web - its free and covers threads
    very well.

    --
    Regards

    John Timney
    Microsoft MVP
    (http://support.microsoft.com/support/mvp/program.asp)
    Co-Author Professional JSP
    ISBN: 1-861003-62-5



    Pavan <Pavan_cv@hotmail.com> wrote in message
    news:39d61c14$1@news.devx.com...

    Hi,
    Would like if someone gave a basic explanation of how
    to use start(), init(), stop() methods in an applet.

    Thanx
    Pavan




  3. #3
    Tom Duffy Guest

    Re: Doubt on using Threads / applets


    Hello Pavan:

    In an applet, these aren't really thread methods per se. Rather, they control
    the life-cycle of the applet relative to the browser. You must include an
    init() method as it is the entry point for the applet - much like the main
    method in an application. start(), stop(), and destroy() are optional.
    stop() is called whenever a user leaves the page with the applet on it.
    start() is called whenever the user returns to the page. destroy() is called
    when the browser is killed. These methods allow the developer to clean up
    any resources while the user is going to another page or to re-allocate them
    when the user returns.

    As an example, suppose you have an applet that loops a sound file. You'd
    probably start the sound playing in the init() method. You wouldn't want
    the sound to keep playing when the user leaves the page, so you'd stop it
    in the stop() and destroy() methods. Then, if you want the sound to start
    when a user returns to the page, just start it again in the start() method.

    HTH,

    Tom Duffy

    "Pavan" <Pavan_cv@hotmail.com> wrote:
    >
    >Hi,
    >Would like if someone gave a basic explanation of how
    >to use start(), init(), stop() methods in an applet.
    >
    >Thanx
    >Pavan
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center