How to load an image into a JPanel using Java

So can’t comment(need 50 rep) but your file path is completely wrong

you need it to be something like this

new File("C:/Users/"Insert Username"/Desktop/workspace/Java/BSC_Project/Application/src/resources/background.jpg")

except I’m not on your computer so you need to figure out your own file path, This would be assuming your workspace folder is on your Desktop which it almost certainly isn’t, do you understand?

Leave a Comment