aspose file tools*
The moose likes Applets and the fly likes start stop init destroy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "start stop init destroy" Watch "start stop init destroy" New topic
Author

start stop init destroy

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4339
    
    2

im as confused about this now as i was 11 years ago. i created an applet that started a thread to scroll some text in an infinite while loop. i was concerned about this thread continuing to run after the page was left so i wrote this:


even then the API said stop, suspend,resume, and destroy methods of Thread class were deprecated.

is stopping that thread something i should do something about? or can i just delete most of that code i just posted?

according to the current API(like the old one) i should do something. here are some quotes:

public void start()
A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is visited. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

public void stop()
A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is no longer visible. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

public void destroy()
A subclass of Applet should override this method if it has any operation that it wants to perform before it is destroyed. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

notice how they use the words suspend, resume, and destroy method to kill?

so are they just trying to make me lose more of my hair?


SCJP
Visit my download page
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: start stop init destroy
 
Similar Threads
determining minimum dimensions of an Applet
Applet focus problem, I think
suspend/resume fix please help
container not appearing
does a JTextArea need some event listener?