I'm currently working on a little game and I want to upload it when it's finished. But I have one problem. When I'm creating a refference to my Data with ImageIO.read I can only refference the specific path of the file. But if for example someone downloads it and puts it into another folder the code can't see the file anymore. Here is a visual representation of my problem:
static BufferedImage H;
static BufferedImage J;
public Boss() {
try {
H = ImageIO.read(new File("\\test\\Boss\\Hintergrund\\Hintergrund_01_B.jpeg"));
J = ImageIO.read(new File("Hintergrund_01_B.jpeg"));
}catch(IOException e) {
e.printStackTrace();
System.out.println("data not found");
}
}
Here H can be read and J not. Why is that? Thanks for everyone who is willing to help me.