Answer the question
In order to leave comments, you need to log in
How to correctly write the path to a .png image in java?
Hello, I'm trying to set the path to the image in java. The image is located in the data folder, the data folder itself lies parallel to the src folder. The line where the image is read:
Image cellTexture = new Image(getClass().getResourceAsStream("data\\Cell.png"));
. I tried everything I found on the internet and nothing works. In another project, the same path correctly leads to a file (text) with the same location. Thanks for the advice.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question