DzzD
|
 |
«
Posted
2008-03-14 00:37:07 » |
|
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
|
|
|
|
jojoh
|
 |
«
Reply #1 - Posted
2008-03-14 10:44:36 » |
|
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.
|
|
|
|
DzzD
|
 |
«
Reply #2 - Posted
2008-03-14 16:06:27 » |
|
Applet didn't start on FF 2.0.0.12, WinXP, Java 6 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. There was no loading progression on either FF or IE, but maybe it was just that quick. yep that's true, needed ressources are very small so they may load in a seconde thank's for your feedback
|
|
|
|
Games published by our own members! Check 'em out!
|
|
brackeen
|
 |
«
Reply #3 - Posted
2008-03-14 18:31:15 » |
|
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
|
|
|
|
|
DzzD
|
 |
«
Reply #4 - Posted
2008-03-14 19:39:11 » |
|
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  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 ?
|
|
|
|
Riven
|
 |
«
Reply #5 - Posted
2008-03-14 20:07:13 » |
|
Just tested with FF 2.0.0.12
It hangs on "loading" with darkgreen/darkblue progressbars
Works with Opera 9.25 and IE7
|
|
|
|
brackeen
|
 |
«
Reply #6 - Posted
2008-03-14 20:27:08 » |
|
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();"));
|
|
|
|
|
Riven
|
 |
«
Reply #7 - Posted
2008-03-14 20:33:46 » |
|
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?
|
|
|
|
DzzD
|
 |
«
Reply #8 - Posted
2008-03-14 21:07:04 » |
|
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 ?
|
|
|
|
Riven
|
 |
«
Reply #9 - Posted
2008-03-14 21:57:58 » |
|
Nothing changed in FF, it still hangs on the two progressbars 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
DzzD
|
 |
«
Reply #10 - Posted
2008-03-15 00:35:00 » |
|
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
|
|
|
|
Riven
|
 |
«
Reply #11 - Posted
2008-03-15 00:45:18 » |
|
Works! 
|
|
|
|
DzzD
|
 |
«
Reply #12 - Posted
2008-03-15 00:55:59 » |
|
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: 1 2 3
| <HEAD> <SCRIPT language=JavaScript src=SmoothApplet.js></SCRIPT> </HEAD> |
2) Applet tag name have to be modified with APPLETLOADER as below 1 2 3 4 5 6 7
| <APPLETLOADER archive="LIB/dzzd.jar,LIB/extension.jar" code = "Road.class" width = "100%" height = "100%" MAYSCRIPT> </APPLETLOADER> |
3) the startApplets() function must be called once loaded, this can be achieved by jscript or by adding onload attribute 1
| <BODY onload="startApplets()"> |
4) 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  you may embed Appletloader tag in another HTML element showing that applet is loading as below 1 2 3 4 5 6 7 8 9
| <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!
|
|
|
|
CommanderKeith
|
 |
«
Reply #13 - Posted
2008-03-15 04:13:31 » |
|
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.
|
|
|
|
g666
|
 |
«
Reply #14 - Posted
2008-03-15 12:03:34 » |
|
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. 
|
desperately seeking sanity
|
|
|
DzzD
|
 |
«
Reply #15 - Posted
2008-03-15 13:36:16 » |
|
the problem is imo the 1-2 seconds of browser freeze that you get when the vm loads for the first time 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 ? I did notice the orange java loading logo the very first time it loaded, but that's not a big deal. 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
|
|
|
|
princec
|
 |
«
Reply #16 - Posted
2008-03-22 18:51:12 » |
|
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 
|
|
|
|
DzzD
|
 |
«
Reply #17 - Posted
2008-03-22 20:40:22 » |
|
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. 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. I think that can not be done with JS , using flash is a funny idea  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.
|
|
|
|
DzzD
|
 |
«
Reply #18 - Posted
2008-03-25 12:14:51 » |
|
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=6669818NB: as explained in the bug description, it seems that there is a workaround for socket security exception with FF and liveconnect.
|
|
|
|
DzzD
|
 |
«
Reply #19 - Posted
2008-04-02 23:43:36 » |
|
I try the solution proposed in the sun bug thread using the following applet as warmup applet : import java.applet.Applet; import java.net.URLConnection; import java.io.IOException;
public class SmoothApplet extends Applet { public void init() { try { URLConnection uc=getCodeBase().openConnection(); uc.connect(); } catch(IOException ioe) { ioe.printStackTrace(System.out); }
}
} 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
|
|
|
|
Riven
|
 |
«
Reply #20 - Posted
2008-04-02 23:57:10 » |
|
both work in FF on Vista x64
|
|
|
|
|
|
SimonH
|
 |
«
Reply #22 - Posted
2008-04-03 02:15:00 » |
|
oops! ROAD; 1 2 3 4 5 6 7 8
| File Version : 0 Mesh Version : 0 Units : 0.0 Background Color : 0
Exception in thread "Thread-7" java.lang.NullPointerException at Road.run(Road.java:120) at java.lang.Thread.run(Unknown Source) |
FF 2.0.0.13 Win2K java 1.5 ROAD4 works fine! (bit too much console output!) - Can you loosen the steering a bit? 
|
|
|
|
|
|
|