Copied the teacher

This commit is contained in:
Sage The DM 2024-10-22 09:56:16 +02:00
parent b51bc8d120
commit df0fabee6f
2 changed files with 6 additions and 10 deletions

View file

@ -3,26 +3,22 @@ package com.example;
import javafx.application.Application; import javafx.application.Application;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.layout.StackPane; import javafx.scene.text.Font;
import javafx.stage.Stage; import javafx.stage.Stage;
/**
* JavaFX App
*/
public class App extends Application { public class App extends Application {
@Override @Override
public void start(Stage stage) { public void start(Stage stage) {
var javaVersion = SystemInfo.javaVersion(); Label label = new Label("Hello World");
var javafxVersion = SystemInfo.javafxVersion(); label.setFont(new Font(40));
Scene scene = new Scene(label);
var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
var scene = new Scene(new StackPane(label), 640, 480);
stage.setScene(scene); stage.setScene(scene);
stage.setTitle("Welcome to JavaFX!");
stage.show(); stage.show();
} }
public static void main(String[] args) { public static void main(String[] args) {
launch(); launch();
} }