Is there anything wrong with doing this:
public static Image getPicture01()
{
Applet app = new Applet();
Image t = app.getImage(app.getClass().getResource("/res/pic01.png"));
return t;
}
My goal is to get a resource (image) from my project in Java, and use it.
Yes, it is totally unnecessary, wasteful (creating an unneeded object, Applet), and there are better alternatives — ImageIO.read(…) for one.