-
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
-
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
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks