Loading image outside of project
I want to have a project that has some folders next to my jar file:
+- MyProject.jar
+- graphics
+- image1.jpg
+- image2.jpg
+- paper.jpg
+- plugins
+- plugin1.jar
+- plugin2.jar
+- plugin3.jar
Within MyProject.jar I have this line:
URL loc = this.getClass().getResource("/../graphics/paper.jpg");
which is triggering this error:
Exception in thread "Timer-0" java.lang.IllegalArgumentException: input ==
null!
at javax.imageio.ImageIO.read(ImageIO.java:1388)
at fotofilter.filters.Blueprint.getPaper(Blueprint.java:116)
at fotofilter.filters.Blueprint.filter(Blueprint.java:45)
at fotofilter.FotoFilter.blueprint(FotoFilter.java:103)
at fotofilter.FotoFilter$1.run(FotoFilter.java:55)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Am I using this properly?
No comments:
Post a Comment