diff --git a/Code/ost/_00_hello_world/src/main/java/com/example/App.java b/Code/ost/_00_hello_world/src/main/java/com/example/App.java index d2930cc..dbf87b2 100644 --- a/Code/ost/_00_hello_world/src/main/java/com/example/App.java +++ b/Code/ost/_00_hello_world/src/main/java/com/example/App.java @@ -10,7 +10,8 @@ import javafx.stage.Stage; * JavaFX App */ public class App extends Application { - + // Method start is already defined int the library Application so we have to + // Override it @Override public void start(Stage stage) { diff --git a/Code/ost/_00_hello_world/target/classes/com/example/App.class b/Code/ost/_00_hello_world/target/classes/com/example/App.class index 247092f..65da249 100644 Binary files a/Code/ost/_00_hello_world/target/classes/com/example/App.class and b/Code/ost/_00_hello_world/target/classes/com/example/App.class differ diff --git a/Code/ost/_01_hello_world/pom.xml b/Code/ost/_01_hello_world/pom.xml new file mode 100644 index 0000000..1ca6d84 --- /dev/null +++ b/Code/ost/_01_hello_world/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.example + _01_hello_world + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.6 + + + + + default-cli + + com.example.App + + + + + + + diff --git a/Code/ost/_01_hello_world/src/main/java/com/example/App.java b/Code/ost/_01_hello_world/src/main/java/com/example/App.java new file mode 100644 index 0000000..f7f7cfc --- /dev/null +++ b/Code/ost/_01_hello_world/src/main/java/com/example/App.java @@ -0,0 +1,30 @@ +package com.example; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + @Override + public void start(Stage stage) { + var javaVersion = SystemInfo.javaVersion(); + var javafxVersion = SystemInfo.javafxVersion(); + + var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + "."); + var scene = new Scene(new StackPane(label), 640, 480); + stage.setScene(scene); + stage.show(); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/Code/ost/_01_hello_world/src/main/java/com/example/SystemInfo.java b/Code/ost/_01_hello_world/src/main/java/com/example/SystemInfo.java new file mode 100644 index 0000000..b566a3e --- /dev/null +++ b/Code/ost/_01_hello_world/src/main/java/com/example/SystemInfo.java @@ -0,0 +1,13 @@ +package com.example; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/Code/ost/_01_hello_world/src/main/java/module-info.java b/Code/ost/_01_hello_world/src/main/java/module-info.java new file mode 100644 index 0000000..5918012 --- /dev/null +++ b/Code/ost/_01_hello_world/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.example { + requires javafx.controls; + exports com.example; +} diff --git a/Code/ost/_01_hello_world/target/classes/com/example/App.class b/Code/ost/_01_hello_world/target/classes/com/example/App.class new file mode 100644 index 0000000..7559e7f Binary files /dev/null and b/Code/ost/_01_hello_world/target/classes/com/example/App.class differ diff --git a/Code/ost/_01_hello_world/target/classes/com/example/SystemInfo.class b/Code/ost/_01_hello_world/target/classes/com/example/SystemInfo.class new file mode 100644 index 0000000..487f8e1 Binary files /dev/null and b/Code/ost/_01_hello_world/target/classes/com/example/SystemInfo.class differ diff --git a/Code/ost/_01_hello_world/target/classes/module-info.class b/Code/ost/_01_hello_world/target/classes/module-info.class new file mode 100644 index 0000000..5e9b472 Binary files /dev/null and b/Code/ost/_01_hello_world/target/classes/module-info.class differ