How does a Java application stored within a jar file reference/edit/read other files
(like .txt, or data files,) that are also within the jar file?
Answer: Classes located in a JAR archive are loaded via a class loader whose purpose
is to load classes form JAR archives. This ClassLoader implements the getResource
and getResourceAsStream
methods to retrieve files from the JAR file. So you can take any class from the JAR
and say ClassName.class.getClassLoader().getResource("fname");
to get the resource and use it.