This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
i'm gradually improving the complexity of my application using ant
i started with a jframe that displays an icon, then added images to tabs in a tabbedPane and now i'm trying to display a background image in a panel
though apparently quite simple this is hard: i'm trying to achieve two goals - running and jaring using the img folder in the classpath and also trying to run and jar using the jared img folder in the classpath instead (the idea is mastering these aspects in order to later being able to reference any jar i need to my application, always using ant)
so i have the needed images inside a folder called img
i jared this folder getting an imgjar.jar
in my code i use the path to my images like this (though i tried numerous combinations, mostly because no image entered when i started using packages, but that will be matter for another topic ):
now i "turn off" the imgjar out from the classpath and try to run the application using just the img folder placed in the classpath - all works perfectly
but when, with the very same setup, i jar the application, the background image doesnt show up - and i wonder why
some relevant code:
my ant file:
can someone please help me sorting this out, please?
Joined: Feb 08, 2004
when i "switch" the classpath - i.e. - i put the imgjar in the classpath and remove the img folder from the classpath i get the following result:
when running - the background image is the only one to enter
when i jar the application - the background image is the only one not to enter
i'm sorry but they just dont relate (well, its about the same aplication ) : in this one i've a problem with an image display, while in the other topic i'm questioning concrete jaring with ant - no problems whatsoever with displaying images, just asking how to jar a file
dont you agree?
Joined: Feb 08, 2004
in case someone is interested in this topic, i found a solution, using the trial and error path
below i give the running code, as the ant build file: all you have to to is getting some suitable images
NOTE: this code works as it is - i mean without the use of packages; i'll open another topic concerning this last case