Hi i am making a quiz application with my project partner and at the end of the quiz i am trying to display an image from out of my resource folders to the winners (a trophy). Everything worked fine untill he tried to run the application on his computer. The project is shared, so if he changes something it changes in my files aswell and vice versa.
But at this time i can't even let it work on my computer anymore.
Here is an image how i placed the image in a resourcefolder called Images. You can see this and the code on here.
My code is as follows :
BufferedImage image = null;
java.net.URL url = getClass().getResource("src/Images/trophy.png"); /* Draw an image for the winning team */
try
{
if (url == null)
System.out.println("TEST");
else
{
image = ImageIO.read(url);
g.drawImage(image, w / 2, 300, this); /* Draw the image */
}
}
catch (IOException e)
{
e.printStackTrace();
}
I've already tried cleaning the project like advised in other posts, i've already changed the location to this aswell "/src/Images/trophy.png" but this isn't working aswell. Anybody knows whats wrong?
Thanks!