I try to use JavaFX the first time. I created a project an a *.fxml file in IntelliJ. Then I opend the built in fxml gui editor in IntelliJ. I got a warning, that I need to add a SDK for JavaFX. I went to project structure settings, Modules, Dependencies and added "IntelliJ-dir\jre64\lib\ext\jfxrt.jar". The warning disappeared. The module scope is set to compile. If I try to execute the following code by clicking the play button in IntelliJ next to the class declaration I get "Error: JavaFX runtime components are missing, and are required to run this application"
I don't know what to do now. I think I added the library as inteded but I can't run my Hello World window.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class splash extends Application {
private Button button;
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("Hello World!");
button = new Button("Hi");
StackPane layout = new StackPane();
layout.getChildren().add(button);
Scene scene = new Scene(layout, 300, 250);
stage.setScene(scene);
}
}