I have a problem with Java application, particular in loading a image from a location in my computer.
Following this post I used a BufferedImage and a <
getResource & getResourceAsStream do not work with file paths, but paths relative the code base. If the code base is C: then a relative path that would locate the resource is /ImageTest/pic2.jpg.
..difference between load file by
FileInputStreamandgetResourceAsStream?
One major difference is that the getResource.. will work with a resource inside a Jar, which is no longer a File. Therefore FileInputStream cannot be used to access such a resource.