Alec Porter wrote:So I'm going to assume that I'm getting the path of the directory incorrectly.
If you just want to print to console (as your example would) contents of /images/ from .jar file, like names of images stored there, you should check the JarFile class from java.util.jar; package.
new ImageIcon( getClass().getResource("/images/image.png") )
Alec Porter wrote:The problem is that the jar isn't created till I make the code into a jar file that means there would be no way to test it in the compiler, should I make a separate jar file for images? I wanted to have the images in the same jar as the main class so I could load them like I did in the code. Is it not possible to get the listFiles() to work because their in the jar?