I noticed that the .getResource() method doesn't work when loading a text file from an executable jar file when using a class loader (even though it works fine for ImageIcon instances). But, the .getResourceAsStream() method works perfectly fine for text files. Why is this? In general, which procedure is the better one to use and why? Thanks!
Doesn't work
File f = new File(this.getClass().getClassLoader().getResource().toString());
Works
InputStream input = new InputStreamReader(this.getClass().getClass.Loader().getResourceAsStream());