Re: Applet life cycle on Windows 2000

From: Marcus Shaw (mshaw_at_tesco.net)
Date: 11/20/04


Date: Sat, 20 Nov 2004 09:54:37 GMT

VK wrote:
> Cannot say about the new jJJJava stuff, but in the old Applet stop() method
> has nothing to do with the onfocus/onblur web-page events.
>
> stop() is called when the applet goes out of visible part of the page
> (because of minimize or scroll). This is a way to make an elegante resource
> release for graphics-intensive applets (do not spend cycles for paint() if
> no one can see it anyway). Evidently just switching the focus doesn't always
> call stop() - the page is blur, but still may be visible.

Hi All,

The tutorial at

http://java.sun.com/docs/books/tutorial/applet/overview/lifeCycle.html

Says

"When the user leaves the page -- for example, to go to another page --
the applet has the option of stopping itself. When the user returns to
the page, the applet can start itself again. The same sequence occurs
when the user iconifies and then reopens the window that contains the
applet. (Other terms used instead of iconify are minaturize, minimize,
and close.)"

Well, not what I'm seeing! I modified my test applet to show paint
events as well an init, start, stop and destroy and paint is the only
one that gets called as the applets are scrolled in and out of view.
Only looked at in in IE though.

In reality I can live with the behavior I'm seeing, but it would be so
nice if worked like the tutorial...

Thanks,

Marcus.



Relevant Pages

  • Re: Simple Problem - Question from Book
    ... Sonia, ... >>painting is handled by the paint method, which is turn calls things like ... > that will help an elementary school student learn multiplication. ... > on the applet and ask another multiplication question. ...
    (comp.lang.java.help)
  • Re: JPanel not visible in JApplet
    ... drawing is done by paint() and not init(). ... called when your applet is first invoked. ... the the Panel was painted. ...
    (comp.lang.java)
  • refreshing 2D Graphics screen problem
    ... The following program is an applet that reads a number from a file 10 ... that the method paint is performed. ... public class Shapes extends JApplet { ...
    (comp.lang.java)
  • Re: how and when components get their own size?
    ... First access of the applet is working fine. ... without closing the browser) and hitting again the applet's page the applet crashes because ... Displaying applet's page always causes init() and start, ... them in paint() or paintComponentmethod of custom component. ...
    (comp.lang.java.gui)
  • Re: Double buffer help
    ... "Painting in AWT and Swing": ... I simply duplicated the code from my paint() method in the update ... applet and the new improved applet can both be seen in action. ... Then both paintand updatemethods merely call my new displayRedraw() ...
    (comp.lang.java)