I don't know why in Java it should be so complicated, but I've already spent a good few hours on this. I have a png image in \src\resources\resize-cursor.png
Now, I want to use this image with BufferedImage
class
BufferedImage myPicture = null;
try {
// this is just one of the examples I tried... I've already tried like 10 ways to achieve this but I am always getting NullReferenceException
myPicture = ImageIO.read(getClass().getResourceAsStream("\\resources\\resize-cursor.png")));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Is there a one working way just to link the png resource in my app?