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 time
4 Replies
JavaBot
JavaBot4w ago
This post has been reserved for your question.
Hey @feyong! Please use /close or the Close 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.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot4w ago
Please format your code to make it more readable. For java, it should look like this:
​`​`​`​java
public void foo() {

}
​`​`​`​
​`​`​`​java
public void foo() {

}
​`​`​`​
dan1st
dan1st4w ago
it shouldn't be /main/resources/... but just /css/login.css
JavaBot
JavaBot4w ago
💤 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.

Did you find this page helpful?