I've written an animated, double buffered graphical applet for JDK 1.1.8 (It
has to run without the user having to download a new JRE) that is run in a
table cell on a web page. It uses threads for the animation, with a delay
based on the speed of the animation.
The problem is that on IE, the image does not display until it regains
focus, ie the page is scrolled down, then up, or a second window obscures it
and is then removed. According to the Java console, it has started fine.
It works as it should on FireFox and Opera, and works in IE when it is the
only thing on the page. I have tried everything I can think of (removing the
delay, extra repaints, trying every kind of embedding into the web page,
etc, even trying to get keyboard focus) but to no avail.
Does anyone know what the problem might be?
Thanks,
Greg
Mickey Segal - 30 May 2005 18:09 GMT
Sometimes invalidate/validate is needed; the need for this seems to be
different for different JVMs. For a program in a Frame it is simple to test
this hypothesis by resizing the Frame.
> It works as it should on FireFox and Opera, and works in IE when it is the
> only thing on the page. I have tried everything I can think of (removing
> the delay, extra repaints, trying every kind of embedding into the web
> page, etc, even trying to get keyboard focus) but to no avail.
Gregory Austwick - 30 May 2005 18:33 GMT
I placed the invalidate/validate before the repaint() command in the
thread's Run procedure, as that seems to be the most obvious place to put
it,but it doesn't seem to have helped. Is that the right place for it?
Greg
> Sometimes invalidate/validate is needed; the need for this seems to be
> different for different JVMs. For a program in a Frame it is simple to
[quoted text clipped - 4 lines]
>> (removing the delay, extra repaints, trying every kind of embedding into
>> the web page, etc, even trying to get keyboard focus) but to no avail.
Mickey Segal - 30 May 2005 19:58 GMT
It sounds like that should be fine.
>I placed the invalidate/validate before the repaint() command in the
>thread's Run procedure, as that seems to be the most obvious place to put
>it,but it doesn't seem to have helped. Is that the right place for it?
Gregory Austwick - 31 May 2005 11:22 GMT
It was. It turned out to be a specialist module elsewhere on the page that
was stealing the focus.
Thank you very much for your help though.
Greg
> It sounds like that should be fine.
>
>>I placed the invalidate/validate before the repaint() command in the
>>thread's Run procedure, as that seems to be the most obvious place to put
>>it,but it doesn't seem to have helped. Is that the right place for it?
Andrew Thompson - 31 May 2005 00:38 GMT
> Does anyone know what the problem might be?
It is probably the code you are using. Try preparing a small example
that shows the problem, <http://www.physci.org/codes/sscce.jsp>.

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane