I am having a problem packaging my jar , it not showing any img and after some research i found that i should use the following.
java.net.URL imgURL = getClass().getResource("image.jpg");
if(imgURL != null)
{
displayImage = Toolkit.getDefaultToolkit().getImage(imgURL);
}
however i think i am not setting the path correctly here because the img is in res file in my project and it runs fine under eclipse run but not in jar file , i also inspected the jar file and didn't find the res folder even though i specified the res folder to be added in source in build path.
help is appreciated !

New Topic/Question
Reply




MultiQuote


|