Delayed Applet Loading

I’ve written a lengthy article about different options to dodge the unwanted VM startup surprise. :slight_smile:

Delayed Applet Loading

great article, just what applets need to use.

That’s a great article ;D

Although, it took me a while to figure out your .zip file! You might want to add subdirectories to outline the steps? There is also a bug in applet_iframe.html: “nojs.html” should be “applet_nojs.html” I assume?

The example works fine for me in both IE and Firefox! Thanks for the hard work…

There is also a bug in applet_iframe.html: “nojs.html” should be “applet_nojs.html” I assume?

Oh… my bad. Will fix that right away :open_mouth:

You might want to add subdirectories to outline the steps?

The demo package now contains separate directories for each demo. Each directory contains all required files. That created of course some bloat since it’s dumbass zip, but it’s still pretty small with 56kb.

Also there is now a new preferred method:
http://kaioa.com/node/21#dom_inject2

edit: spelling++

The nicest application of this article might be to load up a site, when it is displayed load a dummy applet in background which is actually invisible, either hidden or just 1 pixel big, and let the VM start up “in the background”. Then, when the user actually proceeds, the VM is up and running and your real applet will start instantly. Using this 2 stept startup process you reduce the “feeling” to “no delay”.

-JAW

This looks pretty interesting. I’d like to see a version using the tag instead of the tag, though. If a page uses the tag, IE users without Java can install Java 6 without leaving the page or restarting the browser - a pretty slick feature.

There’s some good info here: http://ww2.cs.fsu.edu/~steele/XHTML/appletObject.html

yup using this technique for the Hexxagon applet, does work nice.

I can’t help but such techniques always make me feel some kind of afraid, I always fear they are not mature enough and will fail on some strange combinations.

All in all, lets hope the consumer-jvm gets a good start and such workarrounds will be no longer needed (at least for the jvm startup time) :wink:

lg Clemens

[quote]All in all, lets hope the consumer-jvm gets a good start and such workarrounds will be no longer needed (at least for the jvm startup time) Wink
[/quote]
Well, the quick-starter in the consumer VM is Windows-only, so techniques like this are still useful for Linux, Mac, and of course older VMs for Windows.

That said, Sun released their deployment toolkit: https://jdk6.dev.java.net/testDT.html
It’s also JavaScript, but it doesn’t have delayed loading. It would be nice to see a combo of delayed loading with all the features of the deployment toolkit.

after seeing your article wich is nice I cant resist to post a work I did some time ago, wich is quite related/similar to the purpose of it:

http://www.java-gaming.org/forums/index.php?topic=17548.0

there is no special explanation, but it is short enought to be easily understandable.