getClass().getResource("/path/image.png");

Read more of this post