Hi I started a JavaFx course and i copied code from course to try it on my own but to my suprise everything is not working at all. At first intelij didn't recognized any of JavaFx packages so i added it guided by this https://openjfx.io/openjfx-docs/ . Still nothing showed up. There is the code:
package sample;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
public class Main extends Application {
private Label myLabel;
private TextField nameTextField;
public void start(Stage primaryStage) throws Exception{
primaryStage.setTitle("Hello JavaFX");
Button button = new Button();
button.setText("Click Me!");
myLabel = new Label();
nameTextField = new TextField();
myLabel.setText("This is my label");
FlowPane flowPaneRoot = new FlowPane(10, 10);
flowPaneRoot.setAlignment(Pos.CENTER);
flowPaneRoot.getChildren().add(button);
flowPaneRoot.getChildren().add(myLabel);
Scene scene =
new Scene(flowPaneRoot, 250, 200);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
There is error list that i receive: https://pastebin.com/s44d61zE