Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[java] Loading a file from a .jar'ed application

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 GKW   Members   

200
Like
Likes
Like

Posted 24 November 2000 - 07:44 AM

I need to load a .bmp file from a jared application NOT a jared applet. It works just fine until I jar it then the file loader I made no longer finds the bitmap. I searched sun.com and all I could find was a suggestion that I use getClass().getResource( "mybitmap.bmp" ) but like every one else in the forum all I get is a null URL reference. Any suggestions? I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
Opere Citato

#2 snowmoon   Members   

122
Like
Likes
Like

Posted 24 November 2000 - 08:58 AM

Try /mybitmap.bmp otherwise it append the package name of the class object that you are using.

#3 GKW   Members   

200
Like
Likes
Like

Posted 24 November 2000 - 06:43 PM

The problem is that the bitmap is in the jar. It kinda looks like this:

Class Lisa
toothless.crack.whore.Lisa
Hooker.bmp
toothless.crack.whore.pictures.Hooker.bmp

The picture that the class Lisa needs to load is in the jar directory toothless.crack.whore.pictures. I have tried all sorts of combinations of the package with the name of the bitmap but nothing works for the jar. Works just fine outside the jar if I just put the package name infront of the bitmap. If this was an applet I would get the codebase but I don''t know what to do for an application. I thought that having the . in the classpath was supposed to take care of this but I guess not.

I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!

Opere Citato




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.