getResource problem in jar file
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   TIM_M
Posted On:   Monday, September 13, 2004 10:50 AM

I wrote a little program which loads this image through the "javollotest.MainPane class" like this imgMain = new ImageIcon( this.getClass( ).getResource( "/javollotest/images/logo.PNG" ) ); When I run the program through JBuilder it works fine When I create a Native Executable it does not display the images why? I also added the files when I specified the archive contents in the Native Executable Wizard as: "javollotest/images/logo.PNG" The thing is that when I place the images in the same directory as the MainPane class, add the files in specifying the archive contents in the Native Executable Wizard as :javollo/logo.PNG and change my code to: imgMa   More>>

I wrote a little program which loads this image through the "javollotest.MainPane class"
like this
imgMain = new ImageIcon( this.getClass( ).getResource(
"/javollotest/images/logo.PNG" ) );

When I run the program through JBuilder it works fine
When I create a Native Executable it does not display the images why?
I also added the files when I specified the archive contents in the Native Executable Wizard as:
"javollotest/images/logo.PNG"

The thing is that when I place the images in the same directory as the MainPane class, add the files in specifying the archive contents in the Native Executable Wizard as :javollo/logo.PNG and change my code to:

imgMain = new ImageIcon( this.getClass( ).getResource(
logo.PNG" ) );


it works. I am going crazy here I am so confused with these things

   <<Less
About | Sitemap | Contact