Ich versuche seit ca. 5 Tagen ein Programm zu schreiben, welches mir lediglich ein Fenster mit JavaFx anzeigt. Jedoch bekomme ich durchgehend die gleiche Fehlermeldung, egal welche Ratschläge aus anderen Foren/yt-Videos ich befolge.
Code:
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
public class Main extends Application {
@Override
public void start(Stage stage) {
var label = new Label("Hallo");
var scene = new Scene(new StackPane(label), 500, 300);
stage.setTitle("Fenster 1");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
Error: Exception in Application start method
java.lang.reflect.InvocationTargetException

Code:
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
public class Main extends Application {
@Override
public void start(Stage stage) {
var label = new Label("Hallo");
var scene = new Scene(new StackPane(label), 500, 300);
stage.setTitle("Fenster 1");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
Error: Exception in Application start method
java.lang.reflect.InvocationTargetException
