• Advertisement
Sign in to follow this  

[java] getResourceAsStream insanely slow in Applet

This topic is 2444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
<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>

Share this post


Link to post
Share on other sites

<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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
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>

Share this post


Link to post
Share on other sites

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

Yeah, I have that too, but this is not the certificate info. Remove your own certificate (with jcontrol) and see how your Security dialog looks.

Share this post


Link to post
Share on other sites

[quote name='Wilhelm van Huyssteen' timestamp='1307644749' post='4821427']
for name and publisher: I manualy added it to the jnlp file. Note title and vendor.

Yeah, I have that too, but this is not the certificate info. Remove your own certificate (with jcontrol) and see how your Security dialog looks.
[/quote]

Sorry im not 100% sure how the certificate works. However i can tell you the only other thing i did apart from setting the parameters in my jnlp file was use Jarmaker to create my keystore and sighn the jar.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement