feyong
JCHJava Community | Help. Code. Learn.
ā¢Created by feyong on 1/4/2025 in #java-help
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 time7 replies