I\'m trying to access a file in my project. But getResource method returns null.
This is how my project looks like:
Is there a reason you're using the the class loader of the current class? Something like this.getClass().getClassLoader().getResource("/xxx.png") should be more reliable.
this.getClass().getClassLoader().getResource("/xxx.png")