• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applets

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Applets do not have a main() method how come they work ?
 
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An applet is a small program that is intended not to be run on its own, but rather to be embedded inside another application.
We write an applet by making it a subclass of the Applet class. The class overrides four Applet methods so that it can respond to major events:
init()
To initialize the applet each time it's loaded (or reloaded).
start()
To start the applet's execution, such as when the applet's loaded or when the user revisits a page that contains the applet.
stop()
To stop the applet's execution, such as when the user leaves the applet's page or quits the browser.
destroy()
To perform a final cleanup in preparation for unloading.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are running an Applet the BROWSER is actually the program that is running and it was probably not written in java. The four methods that Applets use are a "contract" or agreement between java and the browser so that you can give the browser instructions on how to start, maintain and close down your Applet.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic