JavaFx FXML Import Not Working

Question: My code is not running and gives this error message error: package javafx.fxml is not visible
import javafx.fxml.*;
(package javafx.fxml is declared in module javafx.fxml, which is not in the module graph)
1 error

Repl link:

code snippet

Try creating a resources directory and placing your effortlogger.fxml inside it.

Also adjust the path in getResource to match the new location:

Parent root = FXMLLoader.load(getClass().getResource("/resources/effortlogger.fxml"));

click on the three dots in your project explorer (in the left sidebar) and click show hidden items.

One of the files that appears will be a config file called “.replit”

in that file you will see “–add-modules” followed by a list of modules that are necessary for your project to build.

I added a comma after the one that was listed in that part of the file when I opened it and “javafx.fxml” after.

However this did not fix the problem for me. It is only a start. I am still looking into this.