From c892ebfdec4e06e82d1c99017593e583a0b12a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hallvard=20Tr=C3=A6tteberg?= Date: Wed, 11 Aug 2021 15:12:25 +0000 Subject: [PATCH] Upgrade to java 16 --- .gitpod.Dockerfile | 7 ++ .gitpod.yml | 10 ++ javafx-template/.gitignore | 2 + javafx-template/pom.xml | 97 +++++++++++++++++++ javafx-template/src/main/java/app/App.java | 29 ++++++ .../src/main/java/app/AppController.java | 11 +++ .../src/main/resources/app/App.fxml | 16 +++ 7 files changed, 172 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml create mode 100644 javafx-template/.gitignore create mode 100644 javafx-template/pom.xml create mode 100644 javafx-template/src/main/java/app/App.java create mode 100644 javafx-template/src/main/java/app/AppController.java create mode 100644 javafx-template/src/main/resources/app/App.fxml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..22ece18 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,7 @@ +FROM gitpod/workspace-full-vnc + +USER gitpod + +RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \ + && sdk install java 16.0.1.hs-adpt \ + && sdk default java 16.0.1.hs-adpt" diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..d22e096 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +image: + file: .gitpod.Dockerfile + +tasks: + - init: sdk use java 16.0.1.hs-adpt + command: cd javafx-template; mvn compile + +ports: + # used by virtual desktop and vnc, supports JavaFX + - port: 6080 diff --git a/javafx-template/.gitignore b/javafx-template/.gitignore new file mode 100644 index 0000000..2131639 --- /dev/null +++ b/javafx-template/.gitignore @@ -0,0 +1,2 @@ +# ignore maven build folder +target/ diff --git a/javafx-template/pom.xml b/javafx-template/pom.xml new file mode 100644 index 0000000..c3e9984 --- /dev/null +++ b/javafx-template/pom.xml @@ -0,0 +1,97 @@ + + 4.0.0 + it1901 + javafx-template + 0.0.1-SNAPSHOT + + + UTF-8 + 16 + 16 + + + + + + + org.openjfx + javafx-controls + 16 + + + org.openjfx + javafx-fxml + 16 + + + + + org.junit.jupiter + junit-jupiter-api + 5.7.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.7.2 + test + + + org.junit.jupiter + junit-jupiter-params + 5.7.2 + test + + + + + org.testfx + testfx-core + 4.0.16-alpha + test + + + org.testfx + testfx-junit5 + 4.0.16-alpha + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 16 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + + org.openjfx + javafx-maven-plugin + 0.0.6 + + + + + default-cli + + app.App + + + + + + + diff --git a/javafx-template/src/main/java/app/App.java b/javafx-template/src/main/java/app/App.java new file mode 100644 index 0000000..17d788e --- /dev/null +++ b/javafx-template/src/main/java/app/App.java @@ -0,0 +1,29 @@ +package groupid; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; + +/** + * JavaFX App + */ +public class App extends Application { + + private static Scene scene; + + @Override + public void start(Stage stage) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("App.fxml")); + Parent parent = fxmlLoader.load(); + stage.setScene(new Scene(parent)); + stage.show(); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/javafx-template/src/main/java/app/AppController.java b/javafx-template/src/main/java/app/AppController.java new file mode 100644 index 0000000..348e0f6 --- /dev/null +++ b/javafx-template/src/main/java/app/AppController.java @@ -0,0 +1,11 @@ +package groupid; + +import java.io.IOException; +import javafx.fxml.FXML; + +public class AppController { + + @FXML + private void switchToSecondary() throws IOException { + } +} diff --git a/javafx-template/src/main/resources/app/App.fxml b/javafx-template/src/main/resources/app/App.fxml new file mode 100644 index 0000000..b0e6c58 --- /dev/null +++ b/javafx-template/src/main/resources/app/App.fxml @@ -0,0 +1,16 @@ + + + + + + + + + +