Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

keep running an applet with thread.

 
Ramneek Handa
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!