File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the order of execution

 
gayathri bhushan
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i would like to know the order or flow of execution of a java program and an applet when compiling and running...
like it starts with main...and then..
looking forward for a good reply...
gayathri
 
Val Dra
Ranch Hand
Posts: 439
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
order is init, start, paint , stop
 
Grant Crofton
Ranch Hand
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An application just does main().
Not sure about compilation, though.
 
Graeme Brown
Ranch Hand
Posts: 193
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet lifecycle is a bit more complicated than described above.
It is correct that init is called first, then start. After that stop will be called if the browser loses the focus (the user moves to another window) and start will be called when focus is regained. Lastly destroy is called. Paint can be called at any time that the screen area needs to be refreshed, resizing the window or dragging another window over the top etc etc.
To summarise
init() first
then one or more iterations of start() - stop()
finally destroy()
 
gayathri bhushan
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks to all of you.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic