User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 363,806 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,655 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting

Loading images from executable jar file?

Join Date: May 2008
Posts: 37
Reputation: TheWhite is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
TheWhite TheWhite is offline Offline
Light Poster

Re: Loading images from executable jar file?

  #14  
May 9th, 2008
Here, maybe you can take a look at my code... I cut out most of the gooie/extra stuff so you can text it out..

Right clicking should show a flag then a ? then nothing.

If you extract the jar file, you will find my source code, the images, and the compiled .class files. If you run it, the program runs, but the icons dont show.
http://www.fileden.com/files/2008/2/...ineSweeper.jar

I'm not using getResource atm so extracting the jar and moveing the image folder next to the jar will show icons. When I try to use getClass().getResource(), i get nullpointererror...

Hopefully this helps you see what I see..
Reply With Quote  
All times are GMT -4. The time now is 11:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC