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?