Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


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   -  Reputation: 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

Sponsor:

#2 snowmoon   Members   -  Reputation: 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   -  Reputation: 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.



PARTNERS