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
Joined: Jan 26, 2001
order is init, start, paint , stop
Val SCJP <BR>going for SCJD
Joined: Nov 08, 2000
An application just does main(). Not sure about compilation, though.
Joined: Oct 13, 2000
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()