diff --git a/eugeneamedior/eugene b/eugeneamedior/eugene new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/eugeneamedior/eugene @@ -0,0 +1 @@ + diff --git a/eugeneamedior/eugeneamedior.iml b/eugeneamedior/eugeneamedior.iml new file mode 100644 index 00000000..1eacedf1 --- /dev/null +++ b/eugeneamedior/eugeneamedior.iml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eugeneamedior/pom.xml b/eugeneamedior/pom.xml new file mode 100644 index 00000000..76cde837 --- /dev/null +++ b/eugeneamedior/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + com.example + eugeneamedior + 1.0-SNAPSHOT + eugeneamedior + + + UTF-8 + 5.8.1 + + + + + org.openjfx + javafx-controls + 11.0.2 + + + org.openjfx + javafx-fxml + 11.0.2 + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 0 + 0 + + + + org.openjfx + javafx-maven-plugin + 0.0.8 + + + + default-cli + + com.example.eugeneamedior/com.example.eugeneamedior.HelloApplication + app + app + app + true + true + true + + + + + + + \ No newline at end of file diff --git a/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloApplication.java b/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloApplication.java new file mode 100644 index 00000000..50d7a621 --- /dev/null +++ b/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloApplication.java @@ -0,0 +1,27 @@ +package com.example.eugeneamedior; + +// Name: Eugene Komla Senyo Amedior +// ID: 10910921 + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; + +public class HelloApplication extends Application { + @Override + public void start(Stage stage) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml")); + Scene scene = new Scene(fxmlLoader.load(), 320, 240); + stage.setTitle("Hello!"); + stage.setScene(scene); + stage.show(); + } + + public static void main(String[] args) { + launch(); + + } +} \ No newline at end of file diff --git a/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloController.java b/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloController.java new file mode 100644 index 00000000..e45e0b7f --- /dev/null +++ b/eugeneamedior/src/main/java/com/example/eugeneamedior/HelloController.java @@ -0,0 +1,14 @@ +package com.example.eugeneamedior; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; + +public class HelloController { + @FXML + private Label welcomeText; + + @FXML + protected void onHelloButtonClick() { + welcomeText.setText("Welcome to JavaFX Application!"); + } +} \ No newline at end of file diff --git a/eugeneamedior/src/main/java/module-info.java b/eugeneamedior/src/main/java/module-info.java new file mode 100644 index 00000000..859041f0 --- /dev/null +++ b/eugeneamedior/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module com.example.eugeneamedior { + requires javafx.controls; + requires javafx.fxml; + + + opens com.example.eugeneamedior to javafx.fxml; + exports com.example.eugeneamedior; +} \ No newline at end of file diff --git a/eugeneamedior/src/main/resources/com/example/eugeneamedior/hello-view.fxml b/eugeneamedior/src/main/resources/com/example/eugeneamedior/hello-view.fxml new file mode 100644 index 00000000..325e7b96 --- /dev/null +++ b/eugeneamedior/src/main/resources/com/example/eugeneamedior/hello-view.fxml @@ -0,0 +1,16 @@ + + + + + + + + + + + + +