Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1058205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:59:25+00:00 2026-05-16T17:59:25+00:00

The javadoc and tutorial have information about the four applet lifecycle methods ( init()

  • 0

The javadoc and tutorial have information about the four applet lifecycle methods (init() -> start() -> stop() -> destroy()). But they talk mostly in abstract language.

What I’m looking for are concrete examples of when it makes a difference if I put my code in init vs start, and similarly for destroy vs stop. The only thing I’ve found so far is in the tutorial’s description of the destroy method. It says:

Note: Keep implementations of the
destroy method as short as possible,
because there is no guarantee that
this method will be completely
executed. The Java Virtual Machine
might exit before a long destroy
method has completed.

(I’m a bit shocked that the above isn’t in the javadoc.)

Edit: to be more specific: Can anyone provide a browser + JVM combo that, upon some specific action (switching tabs, hitting the ‘back’ button, etc.), invokes stop but not destroy (or start but not init)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:59:26+00:00Added an answer on May 16, 2026 at 5:59 pm

    init and destroy are called when the applet is loaded or unloaded, respectively. It’s possible for a browser to load an applet and stop it, but not destroy it, when navigating around, switching tabs, etc.

    start and stop are for pausing and resuming the applet, in the case above (when the applet becomes, or ceases to be, shown on a page).

    I don’t know if any browser actually does keep an applet loaded, so it may not matter much. But as far as i learned it, the general rule is:

    • init should get the applet ready to run, but not actually set it in motion. The applet should be in a “stopped” state upon return from init. (A stopped applet should be using as few resources as practically possible, and no CPU.)
    • start should start the applet running (starting threads, etc). It generally won’t read params and reload images and all that, as that should be done in init.
    • stop should undo what start does…returning the applet to the “stopped” state, but leaving it able to start again. It should not undo any of init‘s work, as that would leave the applet unstartable if the functionality is properly separated.
    • destroy should do any final cleanup before the applet is unloaded. It basically undoes init. It should not stop the applet; that’s stop‘s job, and should already be done before destroy is called.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom javadoc tag ( @todo ) attached to some methods and
The javadoc about the class java.lang.ThreadLocal is making me confused. They are saying that
The Javadoc about String.intern() doesn't give much detail. (In a nutshell: It returns a
my JavaDoc doesn't work when I have a code example with an annotation. Any
I have made my Actor , but I am unclear on how to take
I have a Custom Listview but i'm running into a weird issue when I
The Javadoc for AsynchronousByteChannel.read() says the operation takes place asynchronously, but what happens when
I have a javadoc doclet that requires an additional jar file to be on
What JavaDoc tags should I use in private fields and methods in order to
Using Javadoc 1.5, I have been unable to create a @link to an Enumeration

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.