Looking for the "Smooth Applet Loader" Grall ? yet another try ... (Updated 3)

Working on a Smooth Applet loader a cupple of monthes ago, I have now reviewed the whole and finally ends up with a smaller, easier and lighter version, follow the links for details, source files and sample:

http://dzzd.net/demo/ROAD/

It may be compatible FF/IE/Safari & all JVM

Note that it works best with IE6, enven if it works with FF, unfortunatly FF seems to not really like applets : hanging, unkilled process, exception…

EDIT:
there is a know issue with FF (wich is a FF/Java bug…on sockets) about security exception as the sample applet is not the subject of this thread this is not an issue for the Applet Loader Script, to avoid this bug JVM warmup is disable in script for FF this one can be enable for applet not using socket

EDIT: update 3
try to correct FF issue using a warmup applet that make a server connection before anycall to liveconnect

Applet didn’t start on FF 2.0.0.12, WinXP, Java 6. The Java loading screen also flashed by between the spinning thing and “loading” screen, but then it was just stuck at the loading screen. Tried refresh and reload, but no luck. There was no loading progression on either FF or IE, but maybe it was just that quick. Worked fine with IE7.

[quote]Applet didn’t start on FF 2.0.0.12, WinXP, Java 6
[/quote]
yep as explained abve this is a kow bug of the applet with FF due to a FF/Java bug, this dont care this is not a Applet Loader bug, if you see the loading bar than it mean that applet is loaded and started.

[quote]There was no loading progression on either FF or IE, but maybe it was just that quick.
[/quote]
yep that’s true, needed ressources are very small so they may load in a seconde

thank’s for your feedback

I had the same problem - I thought it was Windows-only, but I just got a report it happens on Linux too. My workaround is to not use LiveConnect if the server is a virtual named-based host.
The bug is here:
http://bugs.sun.com/view_bug.do?bug_id=6622150

Thanks I have read about this bug, this is too bad this avoid the warmup for FF…

what is strange is that I was thinking that I remove liveconnect for firefox as well as safari, I have no more this bug here … with FireFox 2.0.012 I can reproduce bug here and so I am unable to correct :frowning:

I use the following JS to detect FireFox :
var firefox=(navigator.userAgent.toLowerCase().indexOf(“firefox”)!=-1);

@Jojo, do you still have this bugs ?

plz, anybody else able to test with FF and give some feedbacks ?

Just tested with FF 2.0.0.12

It hangs on “loading” with darkgreen/darkblue progressbars

Works with Opera 9.25 and IE7

DzzD, you should be able to avoid LiveConnect altogether on FF. Ironically, this works fine in FF:

applet.getAppletContext().showDocument(new URL(“javascript: notify_appletLoaded();”));

I’m really dying for a smooth user-experience for applets.

I just convinced my boss to use applets for a serious webbased application (where users are not afraid to install Java).

Having everything work smoothly once they got Java installed, would be terrific.

What’s the (upcoming?) license like?

I did not really know that I can licensing such works, What can be done ? is it necessary ? dont really know, I guess it will be free, just try to keep the files header as they are.

I think I found a nice workaround for FF and I have updated web site, not perfect but better.

feedbacks and especially FF one, are welcome ?

Nothing changed in FF, it still hangs on the two progressbars :-\

thanks for your help braken, I remove all liveconnect and no more monitor isactive for FF… it seems that fortunatly FF hang so much that it show applet only once it is loaded when applet is build by javascript.

Riven, I made an update and I think the new verion should be ok now but I cant be sure, so let me know if all works fine for you ?

I also found here a clear explanation of this bug wich has signaled to both mozzila and sun bug database:
http://oueb.org/AppletFireFoxLiveconnectBug.html

Works! :smiley:

nice,

so it is really easy to implements it only requiere some few modification on the HTML

  1. in the header of the web page the javascript must be added:
<HEAD>
<SCRIPT language=JavaScript src=SmoothApplet.js></SCRIPT>
</HEAD>
  1. Applet tag name have to be modified with APPLETLOADER as below
<APPLETLOADER 
	archive="LIB/dzzd.jar,LIB/extension.jar"	
	code	= "Road.class"
	width	= "100%"
	height	= "100%" 	
	MAYSCRIPT> 
</APPLETLOADER>
  1. the startApplets() function must be called once loaded, this can be achieved by jscript or by adding onload attribute
<BODY onload="startApplets()">
  1. finally this requiere that two files to be on the server:
    http://dzzd.net/demo/ROAD/SmoothApplet.js => contain the requiered script
    http://dzzd.net/demo/ROAD/jvmLoader.html => requiered to load a miniapplet to warmup JVM

5)just one more point :slight_smile: you may embed Appletloader tag in another HTML element showing that applet is loading as below

<DIV style="background-image:url(INIT.GIF);background-repeat:no-repeat;BACKGROUND-POSITION: 50% 50%;">
<APPLETLOADER 
	archive="LIB/dzzd.jar,LIB/extension.jar"	
	code	= "Road.class"
	width	= "100%"
	height	= "100%" 	
	MAYSCRIPT> 
</APPLETLOADER>
<DIV>

replace INIT.GIF by your own splash screen

that’s all!

Worked fine on WinXP, firefox 2.

I did notice the orange java loading logo the very first time it loaded, but that’s not a big deal.

I’m not sure what version of java firefox is using for applets. (maybe it would be cool to display the jvm version in your demo applet? )

The flash-style loading thing is great, nice work.

i dont want to be so negative but i dont see what this is meant to fix. the problem is imo the 1-2 seconds of browser freeze that you get when the vm loads for the first time and you get that with this too. :-\

[quote] the problem is imo the 1-2 seconds of browser freeze that you get when the vm loads for the first time
[/quote]
that’s true that hang is too bad, but it cant be removed :(, personnaly I dont think it is a big problem, I am more worry about the hang happening on applet start (more visible on FF), maybe IE give a lower priority to the applet so it not freeze ?

[quote]I did notice the orange java loading logo the very first time it loaded, but that’s not a big deal.
[/quote]
too bad :(, this is really hard to polish that… I am unable to reproduce that on my computer even with java cache off, and if I remove it for FF than the security exception comeback… the only way that can work is maybe what bracken explain above but I would like to make this script independant of applet

One crafty idea is to put your applets on a second page, and have your landing page have a 1x1 applet in it that does nothing to prime the VM. By the time the reader has read the landing page and found the “Click Here To Play!” link that goes to the second page (or maybe creates the applet with DHTML, I dunno…) several handy seconds will have passed in which time the JVM will have booted. Hopefully.

Is there no way of asynchronously doing things in JavaScript? (Like, a separate Thread?) Maybe Flash could do it? Then you could asynchronously load the JVM.

Cas :slight_smile:

good idea, using a second window could be a good idea to force a different process/thread, I will do some try on that but I think that maybe popup blocker will make this solution hard to make, anyway this merit a test.

[quote]Is there no way of asynchronously doing things in JavaScript? (Like, a separate Thread?) Maybe Flash could do it? Then you could asynchronously load the JVM.
[/quote]
I think that can not be done with JS , using flash is a funny idea :slight_smile: but it will make user requiere java & flash too run applet, it make maybe things too more complexe and increase the risk that the applet dont start.

the FF bug about LiveConnect have moved on SUN DB bug… so if you have vote for this one you should do it again here :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6669818

NB: as explained in the bug description, it seems that there is a workaround for socket security exception with FF and liveconnect.

I try the solution proposed in the sun bug thread using the following applet as warmup applet :

this way the FF bug should removed, I have updated two Applet :
http://demo.dzzd.net/ROAD/
http://demo.dzzd.net/ROAD4/

anyone able to give me some feedback on FF plzzzz ?

EDIT:
It run fine on my computer : XP with IE6 / Safari3 / FF2 but I would like to be absolutly sure that it run almost everywhere