[java] getResourceAsStream insanely slow in Applet

Started by
10 comments, last by Wilhelm van Huyssteen 12 years, 10 months ago
Hi,

My Applet is a lot slower than my Application. The problem seems to be getResourceAsStream. Any known fixes/workarounds?
Check out the applet: Lode Runner Retro Applet
or the Announcement topic Lode Runner Retro topic
Advertisement
I dont know if tehres a way to optimize getResource in an applet. There might be but applets are slow and cumebrsome in general.

Have you tried using java webstart? its pretty effective. I have a small 2D game here that uses webstart if youre looking for an example. www.distantmelody.net/spheres-of-madness


I dont know if tehres a way to optimize getResource in an applet. There might be but applets are slow and cumebrsome in general.

Have you tried using java webstart? its pretty effective. I have a small 2D game here that uses webstart if youre looking for an example. www.distantmelody.net/spheres-of-madness



I don't really understand webstart? What is the difference between downloading a zip, unzipping it where you like, double clicking the sh/bat file on the one hand,
and webstart on the other?
A webstart application starts up after the user clicks the link for it (no downloads no zip files no nothing. just click go). In other words its very convenient for the user. So you would use a webstart application for the same reason you would use an applet. To make the users life easier. Also webstart is just a means to launch a standard java application. So theres no performance issues and no special code required.

A webstart application starts up after the user clicks the link for it (no downloads no zip files no nothing. just click go). In other words its very convenient for the user. So you would use a webstart application for the same reason you would use an applet. To make the users life easier. Also webstart is just a means to launch a standard java application. So theres no performance issues and no special code required.


Very well, I added http://java-expert.nl/games/test/webstart/LodeRunnerRetro.jnlp
See if it works please :)

I am a bit weary of just accepting certificates though, same as for an applet...
<P>works 100% on my windows 7 pc and my old windows xp laptop.<BR><BR>Just one thing. It asks to install LWJGL. I see youve added it as an extension in ur jnlp file. I take the source of lwjgl and i add it to my application. I then export everything together in one jar and i use pro guard to take out all unused classes. That way the overhead of lwjgl becomes realy tiny and my users dont get another "Install this dodgy software dialoge box".<BR><BR>Nice work on the game btw! </P>

<P>works 100% on my windows 7 pc and my old windows xp laptop.<BR><BR>Just one thing. It asks to install LWJGL. I see youve added it as an extension in ur jnlp file. I take the source of lwjgl and i add it to my application. I then export everything together in one jar and i use pro guard to take out all unused classes. That way the overhead of lwjgl becomes realy tiny and my users dont get another "Install this dodgy software dialoge box".<BR><BR>Nice work on the game btw! </P>

Thanks for testing wink.gif Now I still need some Linux testers, for some reason that doesn't seem to work (I think it's loading the Windows natives). Update: Wine had associated itself with webstart :) Aaarrrgghhh
LWJGL is a one time install, no big deal. Couldn't get your game to work on my Linux FF/Chrome though, will try Windows XP later.
np.

ah yes. i just put that up last week. stil want to add to it and i havent included the natives for anything but windows yet. but testing it in windows would be apreciated.


testing it in windows would be apreciated.

I just tested it on Windows XP Home Edition. It restarted my system, as soon as I accepted Run, from the security dialog.

How do you get your certificate to look like it does? Mine is horrible:

Security.jpg



I would like to fill in Name and Publisher... (I filled in all fields in keytool)
It restarted your System?! wow thats a first :D. but thnx for testing it.

for name and publisher: I manualy added it to the jnlp file. Note title and vendor.


<!-- test jnlp file -->
<jnlp
spec="1.0+"
codebase="http://www.distantmelody.net/spheres-of-madness/webstart/">
<information>
<title>Spheres of Madness</title>
<vendor>DMStudio</vendor>
<homepage href="http://www.distantmelody.net/"/>
<description>Spheres of Madness</description>
<description kind="short">Spheres of Madness</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" initial-heap-size="256m" max-heap-size="1024M"/>
<jar href="Frost.jar" main="true"/>
<jar href="data.jar"/>
</resources>
<resources os="Windows">
<j2se version="1.6+"/>
<nativelib href="native-windows.jar"/>
</resources>
<application-desc main-class="spheres_of_madness.SpheresOfMadness">
</application-desc>
</jnlp>

This topic is closed to new replies.

Advertisement