diff --git a/.idea/.name b/.idea/.name
index d42f5ad..10029c6 100644
--- a/.idea/.name
+++ b/.idea/.name
@@ -1 +1 @@
-ultimate-tictactoe
\ No newline at end of file
+UltimateTicTacToe
\ No newline at end of file
diff --git a/.idea/runConfigurations/Run_JavaFX.xml b/.idea/runConfigurations/Run_JavaFX.xml
new file mode 100644
index 0000000..3a0d193
--- /dev/null
+++ b/.idea/runConfigurations/Run_JavaFX.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Run.xml b/.idea/runConfigurations/Run_Swing.xml
similarity index 75%
rename from .idea/runConfigurations/Run.xml
rename to .idea/runConfigurations/Run_Swing.xml
index 277a2e3..182ba7f 100644
--- a/.idea/runConfigurations/Run.xml
+++ b/.idea/runConfigurations/Run_Swing.xml
@@ -1,7 +1,7 @@
-
+
-
+
diff --git a/build.gradle b/build.gradle
index a3abed7..fb71f0a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,8 @@
plugins {
id 'java'
+ id 'application'
id 'org.beryx.jlink' version '2.24.4'
+ id 'org.openjfx.javafxplugin' version '0.0.10'
}
group 'de.icaotix.ultimatetictactoe'
@@ -15,6 +17,13 @@ dependencies {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
+javafx {
+ version = "17"
+ modules = [ 'javafx.controls', "javafx.fxml" ]
+}
+
+mainClassName = "$moduleName/de.icaotix.ultimatetictactoe.Main"
+
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher{
diff --git a/settings.gradle b/settings.gradle
index 0e39df0..8f6e411 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,2 @@
-rootProject.name = 'ultimate-tictactoe'
+rootProject.name = 'UltimateTicTacToe'
diff --git a/src/main/java/de/icaotix/ultimatetictactoe/Main.java b/src/main/java/de/icaotix/ultimatetictactoe/Main.java
index 9405816..fa5f7ec 100644
--- a/src/main/java/de/icaotix/ultimatetictactoe/Main.java
+++ b/src/main/java/de/icaotix/ultimatetictactoe/Main.java
@@ -1,12 +1,18 @@
package de.icaotix.ultimatetictactoe;
import de.icaotix.ultimatetictactoe.view.MainWindowView;
+import javafx.application.Application;
import javax.swing.*;
+import java.util.Arrays;
public class Main {
public static void main(String[] args) {
- SwingUtilities.invokeLater(MainWindowView::new);
+ if (System.getenv().containsKey("jfx")) {
+ Application.launch(MainFX.class, args);
+ } else {
+ SwingUtilities.invokeLater(MainWindowView::new);
+ }
}
}
diff --git a/src/main/java/de/icaotix/ultimatetictactoe/MainFX.java b/src/main/java/de/icaotix/ultimatetictactoe/MainFX.java
new file mode 100644
index 0000000..1a54e47
--- /dev/null
+++ b/src/main/java/de/icaotix/ultimatetictactoe/MainFX.java
@@ -0,0 +1,21 @@
+package de.icaotix.ultimatetictactoe;
+
+
+import javafx.application.Application;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+public class MainFX extends Application {
+
+ @Override
+ public void start(Stage stage) {
+ String javaVersion = System.getProperty("java.version");
+ String javafxVersion = System.getProperty("javafx.version");
+ Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
+ Scene scene = new Scene(new StackPane(l), 640, 480);
+ stage.setScene(scene);
+ stage.show();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
index 3c53405..16d5ba0 100644
--- a/src/main/java/module-info.java
+++ b/src/main/java/module-info.java
@@ -1,3 +1,8 @@
-module ultimate.tictactoe.main {
+module UltimateTicTacToe {
requires java.desktop;
+ requires javafx.controls;
+
+ opens de.icaotix.ultimatetictactoe to javafx.graphics;
+
+ exports de.icaotix.ultimatetictactoe;
}
\ No newline at end of file