« This is Hilarious.. | Main| A gadget that does what it claims to do, the Slingbox »

A funny with the SUN JVM

Category
Every now and again, I have to get my hands dirty and do some code. Recently I came across a bug that I first hit about a year ago, I meant to blog about it then but never got the chance so I'll do it now

Here's the deal, in some of our apps we make heavy use of Java applets within a browser, many of our customers use both Microsoft JVM and SUN JVM, so we test extensively on with both. When applets was loading it would always look pretty ugly(this has changed in the later SUN JVMs) to see a grey expanse waiting for the applet to load, so what we do is hide the applet in a DIV, and then when the applet is loaded it calls a javascript function which unhides the DIV.

This looks great and works well with the MS JVM, the issue arises with the SUN JVM. If you have an applet on a page in a hidden DIV and you use the SUN JVM, the applet will never load, yep, NEVER! So it never calls the Javascript fucntion. So how do I get around it? Well rather than hiding the DIV I just have a DIV that starts out at about 1x1 pixels at the side of the screen, which is just enough to let the SUN JVM load the applet and small enough that nobody notices it. It's an interesting bug and not one I could find documented anywhere.

Comments

Gravatar Image1 - its snowing!

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)