The applet below can be used to show the various method invocations done by a web browser during the applet life cycle. The applet maintains two counters, one in a class variable and one in an instance variable, and displays footprints in the Java Console window of your browser.
Enable the display of the Java Console window in your web browser and then watch the messages resulting from actions like visiting or leaving this web page, (de)iconifying the browser, loading another instance of the page in this or an additional browser window, (un)hiding the applet with another window, or dropping this web page from the back/forward/go menu by going back to the referrer page and clicking on a different hyperlink there.
Also notice the different behaviour of different web browsers!
Lars Appel, March 1999