Had no luck getting this to work via what I found on google.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can load any resource that is available on the classpath, which your jar would be a part of, using
ClassLoader.getResource(String)You can obtain a reference to a relevant
ClassLoaderobject usingClass.getClassLoader()If your image were named
myimage.pngand in a directory calledimagesinside your jar, you could get the image like so.You can then use the URL to create an image object in memory.