Applet paint problem (only on IE)

G

Gregory Austwick

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
 
M

Mickey Segal

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.
 
G

Gregory Austwick

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
 
G

Gregory Austwick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top