Accessing Images inside a Jar File

Let’s say I put a Folder named “Images” with Image1.jpg inside a Jar File named ImageJar. Then I drop the Jar file in my C:\ Directory. How will I be able to contact the Jar, Get inside It’s Images folder and load up Image1.jpg ?

Will it be something like this ?

String ImageFile = “C:/ImageJar/Images/Image1.jpg”;

URL ImageURL = getClass().getResource(ImageFile);

Image Picture = new ImageIcon(ImageURL).getImage();

I figured it out. It turns out we can make Jar Objects.

Just use the code I gave you in the other post, feed it the relative path instead of the absolute path.
String ImageFile = “Images/Image1.jpg”;