Reputation: 485
I don't know why this isn't working, but the program says it can't read the input file. This is also being run in Ubuntu, by the way:
Here is the sample code:
URI url = new URI("images/GUI/TitleScreen.PNG");
File file = new File(url.toString());
bg = new ImageBackground(ImageIO.read(file));
The directory is located in the bin folder and src folder of the program as well.
Upvotes: 1
Views: 11351
Reputation: 285415
What if you instead got your image as a stream from a resource? e.g.,
String imgPath = "images/GUI/TitleScreen.PNG";
BufferedImage buffImage = ImageIO.read(getClass().getResourceAsStream(imgPath));
bg = new ImageBackground(buffImage);
Upvotes: 4