Basically I just got some results back for an assignment and my results were lower than expected. I was told that when the application was run the images had to be moved and a number of exceptions were thrown:
Exception in thread "main" java.lang.NullPointerException
at uk.ac.aber.dcs.cs12420.aberpizza.gui.FrontGUI.getName(FrontGUI.java:494)
at sun.lwawt.macosx.CPlatformWindow.getInitialStyleBits(CPlatformWindow.java:271)
at sun.lwawt.macosx.CPlatformWindow.initialize(CPlatformWindow.java:228)
Well, I checked a lot of times that the runnable jar file worked before sending everything off. And I checked again now and it still does. The only time where things do not work is if I do not extract the contents and attempt to use the runnable jar file from the zipped folder.
I’m assuming that this is the problem, because the images do not appear and things simply do not work properly. But how am I supposed to use images correctly when running the jar from a zipped folder?
This is a question not a rage by the way. I would like to know if my application should or should not be expected to run without extraction whilst using external images?
Just a little edit: To add to my question: how can I get images working if a runnable jar file is being run directly from the zip file. I.e. how can I make the image files/folder go with the runnable jar file to the temporary location?
Actually, running a file from a zipped folder, will extract your file to a temporary folder and execute it from there. If you have some other files in the archive that your application depends upon, they might not get extracted and hence the error you get.