Here is the HelloWorld JavaFX application that shows the text, Hello, World! and Exit:
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.control.Button;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class HelloWorld extends Application {
public static void main(String... args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
Text txt = new Text("Hello, world!");
txt.relocate(135, 40);
Button btn = new Button("Exit");
btn.relocate(155, 80);
btn.setOnAction(e:> {
System.out.println("Bye! See you later!");
Platform.exit();
});
Pane pane = new Pane();
pane.getChildren().addAll(txt, btn);
primaryStage...