Applet drawing before visible
So, I wrote this big applet interface to one of our local control systems. Lately I modified it so that the first thing it does is show an animation for two seconds before showing the controls. (Just eye candy to impress the clients.)
This works just fine when I first visit the applet -- the animation plays for two seconds. And it works fine if I clear the class cache and then refresh the browser window.
However, if I simply refresh the browser window, then only something like the last half of the animation plays, or sometimes none at all. It seems to me like the applet starts running before it is actually possible to see the applet painting in the browser window. So, in other words, the user doesn't start watching the animation until it is half-finished. (Tested this under Firefox.)
My question: Is there some trick to ensure that nothing is painted to the applet window until it is actually possible for the user to see it?