Not trying to be rude, but your post is very vague. Without supplying us with how you store your resources or access them, the best we can do is give you a quick tutorial and hope that helps, or link you to a tutorial elsewhere.
Do you use an IDE?
If so, which one?
Are your images stored within a folder in the project?
If not, where are they?
If you’re using Eclipse, I might be able to help somewhat.
I.E.
Your project’s main folder is called SomeRandomGame.
And your source is located at /SomeRandomGame/src
You can put a folder in /SomeRandomGame (The name is irrelevant) we’ll call it Resources.
So now you’re storing your images in /SomeRandomGame/Resources
If you created this folder outside Eclipse, refresh your project to update Eclipse(Right-click your project and click Refresh).
From there, right-click your Resources folder, highlight Build Path, and select “Use as Source Folder”
This is just a snippet,
public SpriteSheet(String p)
{
BufferedImage image = null;
try
{
image = ImageIO.read(getClass().getResourceAsStream(p));
if(image != null)
{
width = image.getWidth();
height = image.getHeight();
pixels = new int[width * height];
image.getRGB(0, 0, width, height, pixels, 0, width);
}
else
{
System.out.println("Error: image == NULL @Path: "+p);
}
}
catch(Exception e)
{
e.printStackTrace();
}
if(image != null) { Game.debug("SpriteSheet @Path: "+p+" Created"); }
}
The only part that’s relevant to you is:
image = ImageIO.read(getClass().getResourceAsStream§);
Where p = “/Resources/player_sprite_sheet.png”
You’re accessing them in a relative matter, omitting “/SomeRandomGame”/Resources/player_sprite_sheet.png
I hope this helped a bit, teaching isn’t something I’m good at. If I need to make it clearer, let me know. Good luck, hope you’ve been searching through learning materials since your post.