File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes keep running an applet with thread. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "keep running an applet with thread." Watch "keep running an applet with thread." New topic
Author

keep running an applet with thread.

Ramneek Handa
Ranch Hand

Joined: Nov 10, 2000
Posts: 44
Hi!
I have a confussion.
to keep running an applet why do we alway impliment runable interface.
can't we create a new thread and run that applet in that.
can somebody give me any reason for that.
regards,
Bobby ;-}
maateen ashraf
Ranch Hand

Joined: Jan 08, 2001
Posts: 122
its so simple
just an instance of Thread class then pass "this" to instance of Thread class.
now ur applet class is inside thread ....
i hope this will help U
Rahul Rathore
Ranch Hand

Joined: Sep 30, 2000
Posts: 324
Ramneek, there is NO need to implement the Runnable interface for an applet. You can make, display and run the applet WITHOUT implementing Runnable interface.
But normally we need to carry on some processing or animation in a separate thread. Thus we want the applet to create and start a thread for that purpose. One way to do that is to make the applet implement the Runnable, and then to construct and start a new Thread using the Runnable applet instance.
Ramneek Handa
Ranch Hand

Joined: Nov 10, 2000
Posts: 44
thanks guys for above.
can somebody tell me what is the difference between ranch hand ,greenhorn, bartenders and sheriffs.
[This message has been edited by Ramneek Handa (edited March 14, 2001).]
 
 
subject: keep running an applet with thread.
 
Threads others viewed
Two suggestions
Two suggestions
daemon threads
what will it keep after close a applet firefox tag
System.exit(0) in destroy()
IntelliJ Java IDE