Files in data folder not found by IDE

Guys,
I currently have three files in my data folder inside the sketch’s own folder.
One file, test.db, a file I use with BezierSQL, shows “true” when I run System.out.println(new java.io.File(“test.db”).exists());
With the same script, in the same sketch, I try to do the same with a “.png” file and a “.txt” file, and both come out as false.
I started doing this because a JLabel object with setIcon was not working.

I checked the extensions under Windows 11 (I have the “show file extensions” option checked), I renamed files, changed them, restarted the Processing IDE and rebooted the PC, created a new sketch and so on.
Only the .db file is found. Can someone tell me where am I wrong?

Use sketchFile() or dataFile() to obtain a File object pointing to sketch’s folder.
Use sketchPath() or dataPath() to obtain sketch’s folder path as a String.

I used dataPath() to find out the path I needed and it was the right one.
I’ll try to see if with dataFile() I’ll be able to retrieve either the .png or the .txt file

Thanks, I’ll definetly compare my code with your example, and I’ll gather all the images I need for the project I’m working on.
Hope things get sorted out, because I was really scratching my head today :slight_smile:

I’ll let you know if things worked out!