Hello! Can anybody help me?
I'm creating a JavaFx Application for a project with a friend. He created the .fxml, .css and controllers we needed, buuut... when i try to run the project (we're using gitHub and Visual Studio Code) this error appears:
Exception in Application start method
java.lang.reflect.InvocationTargetException
We're learning 😦 this is our start function in main:
public void start(Stage stage) throws Exception {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/main/resources/fxml/login.fxml"));
loader.setController(new LoginController());
Parent root = loader.load();
Scene scene = new Scene(root);
String css = this.getClass().getResource("/main/resources/css/login.css").toExternalForm();
scene.getStylesheets().add(css);
stage.setScene(scene);
stage.show();
}
❤️ Thanks for taking your time4 Replies
⌛
This post has been reserved for your question.
Hey @feyong! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Please format your code to make it more readable. For java, it should look like this:
it shouldn't be /main/resources/...
but just /css/login.css
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.