0

I know there are several questions out there with the same title but none of them seem to apply.

I have little experience using intellij and scene builder and even less experience developing in JAVAFX.

The problem started when my old computer broke down and I had to buy a new one and download newer versions of both Intellij and Scene Builder.

When I attempt to run my program I get a "location is required" error (after receiving Invocation Target Exceptions and Null pointer errors). What I mean to say this is the latest error I need to resolve.

I have been trying to resolve this problem for 2 months (off and on) and I am frustrated as hell.

I tried a couple of times to uninstall and reinstall Intellij and Scene Builder.

I tried to validate the path I was providing to my Scene Builder screen.

Concerting from:

Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("BlackJackMessage.fxml"));

to an input stream type of load:

File map = new File("C:/users/rbeto/internet_development/BlackJackV3/src/sample/BlackJackGame2.fxml");
InputStream fxmlStream = new FileInputStream(map);
Parent root = loader.load(fxmlStream);
loader.setController("BlackJackController");
jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • 5
    FXML files are resources you should be loading them through the resource loading mechanism. See [How do I determine the correct path for FXML files, CSS files, Images, and other resources needed by my JavaFX Application?](https://stackoverflow.com/questions/61531317/how-do-i-determine-the-correct-path-for-fxml-files-css-files-images-and-other) and [Where to put resource files in JavaFX](https://edencoding.com/where-to-put-resource-files-in-javafx/). Adjust your lookup scheme and actually place the required resource in the correct location so that it can be found. – jewelsea May 17 '23 at 22:28
  • You should edit your question to include the complete stack trace (supplied as text, formatted as code). – jewelsea May 17 '23 at 22:40

0 Answers0