I have created a project, inside the project there is a folder named Source Packages, which contains my packages. I need images, and I want to copy them in a folder inside the project (or better inside the Source packages), so that when I create the .jar the image folder will be inside the jar file. How can I do that in NetBean?
Edit: I still can't figure it out, this is the code:
Image star;
InputStream stream = getClass().getResourceAsStream("images/star.png");
star= ImageIO.read(stream);
It doesn't work, I get the error "IllegalArgumentException input==null"
the folder "images" is inside the folder of the project "Game", if I try with this code:
Image star;
InputStream stream = getClass().getResourceAsStream("images/star.png");
star= Toolkit.getDefaultToolkit().getImage("images/star.png");
it works, what am I doing wrong with the InputStream?