I would like to know the best way of loading a resource in Java:
this.getClass().getResource() (or getResourceAsStream()),Thread.c
I tried a lot of ways and functions that suggested above, but they didn't work in my project. Anyway I have found solution and here it is:
try {
InputStream path = this.getClass().getClassLoader().getResourceAsStream("img/left-hand.png");
img = ImageIO.read(path);
} catch (IOException e) {
e.printStackTrace();
}