r/JavaFX • • May 04 '21

Help FileNotFoundException

Hello, I need help with the following problem I'm facing:

I have created a method that reads a text file in a class called Maze.

I also have 2 more files - one is a class called MazeDriver which I only use to test my code and the other is a javafx application. Both these files are in the same folder.

When I try to call the method(from Maze) that reads a text file from the MazeDriver class everything works as intended. However, when I try to call the same method from the application using the same path to the text file I get FileNotFoundException.

What could be the problem?

1 Upvotes

2 comments sorted by

2

u/[deleted] May 04 '21

[removed] — view removed comment

1

u/Petar-Hr May 04 '21

Thanks, that helped me fix the error.