From f7c10225b987e005b9382cac6184065d827d3a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JuanManuelGuti=C3=A9rrezM?= Date: Thu, 14 Mar 2024 09:47:26 -0600 Subject: [PATCH] Prototipo en JavaFX --- PresentacionJFX/nbactions.xml | 40 ++++++++++ PresentacionJFX/pom.xml | 78 +++++++++++++++++++ .../java/com/gumoio/presentacionjfx/App.java | 30 +++++++ .../gumoio/presentacionjfx/SystemInfo.java | 13 ++++ .../src/main/java/module-info.java | 4 + 5 files changed, 165 insertions(+) create mode 100644 PresentacionJFX/nbactions.xml create mode 100644 PresentacionJFX/pom.xml create mode 100644 PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/App.java create mode 100644 PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/SystemInfo.java create mode 100644 PresentacionJFX/src/main/java/module-info.java diff --git a/PresentacionJFX/nbactions.xml b/PresentacionJFX/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/PresentacionJFX/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/PresentacionJFX/pom.xml b/PresentacionJFX/pom.xml new file mode 100644 index 0000000..25daee1 --- /dev/null +++ b/PresentacionJFX/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.gumoio + PresentacionJFX + 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.4 + + com.gumoio.presentacionjfx.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/App.java b/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/App.java new file mode 100644 index 0000000..7f3bc2f --- /dev/null +++ b/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/App.java @@ -0,0 +1,30 @@ +package com.gumoio.presentacionjfx; + +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/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/SystemInfo.java b/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/SystemInfo.java new file mode 100644 index 0000000..3dc1d90 --- /dev/null +++ b/PresentacionJFX/src/main/java/com/gumoio/presentacionjfx/SystemInfo.java @@ -0,0 +1,13 @@ +package com.gumoio.presentacionjfx; + +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/PresentacionJFX/src/main/java/module-info.java b/PresentacionJFX/src/main/java/module-info.java new file mode 100644 index 0000000..d3bbcaa --- /dev/null +++ b/PresentacionJFX/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.gumoio.presentacionjfx { + requires javafx.controls; + exports com.gumoio.presentacionjfx; +}