diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2021-11-29 20:54:48 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2021-11-29 20:54:48 +0000 |
commit | 63ddd9e636e374bb3a3a3fe8a97ab26c6abc04c9 (patch) | |
tree | 86bc9ec8874429b37895942d44ab6762c1c7a55c /src | |
parent | 23df8ac74740bff51382d2b7fd19945d04e865f1 (diff) | |
download | esotericFORTRAN-63ddd9e636e374bb3a3a3fe8a97ab26c6abc04c9.tar.gz esotericFORTRAN-63ddd9e636e374bb3a3a3fe8a97ab26c6abc04c9.zip |
added hello world javafx program
Diffstat (limited to 'src')
-rw-r--r-- | src/IDE/IDE/HelloApplication.java | 25 | ||||
-rw-r--r-- | src/IDE/IDE/HelloController.java | 14 | ||||
-rw-r--r-- | src/IDE/IDE/hello-view.fxml | 16 | ||||
-rw-r--r-- | src/IDE/Makefile | 5 | ||||
-rw-r--r-- | src/IDE/readme.md | 19 | ||||
-rw-r--r-- | src/UI/.gitkeep | 0 |
6 files changed, 79 insertions, 0 deletions
diff --git a/src/IDE/IDE/HelloApplication.java b/src/IDE/IDE/HelloApplication.java new file mode 100644 index 0000000..aaa728f --- /dev/null +++ b/src/IDE/IDE/HelloApplication.java @@ -0,0 +1,25 @@ +package IDE; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.stage.Stage; +import java.io.File; +import javafx.scene.Parent; + +import java.io.IOException; + +public class HelloApplication extends Application { + @Override + public void start(Stage stage) throws IOException { + Parent root = FXMLLoader.load(getClass().getResource("hello-view.fxml")); + Scene scene = new Scene(root, 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/src/IDE/IDE/HelloController.java b/src/IDE/IDE/HelloController.java new file mode 100644 index 0000000..877e5ba --- /dev/null +++ b/src/IDE/IDE/HelloController.java @@ -0,0 +1,14 @@ +package IDE; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; + +public class HelloController { + @FXML + private Label welcomeText; + + @FXML + protected void onHelloButtonClick() { + welcomeText.setText("Welcome to the FORTRAN compiler application!"); + } +}
\ No newline at end of file diff --git a/src/IDE/IDE/hello-view.fxml b/src/IDE/IDE/hello-view.fxml new file mode 100644 index 0000000..c31d9e2 --- /dev/null +++ b/src/IDE/IDE/hello-view.fxml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.geometry.Insets?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.layout.VBox?> + +<?import javafx.scene.control.Button?> +<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml" + fx:controller="IDE.HelloController"> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/> + </padding> + + <Label fx:id="welcomeText"/> + <Button text="Hello!" onAction="#onHelloButtonClick"/> +</VBox> diff --git a/src/IDE/Makefile b/src/IDE/Makefile new file mode 100644 index 0000000..127db02 --- /dev/null +++ b/src/IDE/Makefile @@ -0,0 +1,5 @@ +all: + javac --module-path ../../../javafx-sdk-17.0.1/lib/ --add-modules javafx.controls,javafx.fxml ./IDE/*.java + +clean: + rm -vf IDE/*.class diff --git a/src/IDE/readme.md b/src/IDE/readme.md new file mode 100644 index 0000000..0dc9faa --- /dev/null +++ b/src/IDE/readme.md @@ -0,0 +1,19 @@ +# esotericFORTRAN IDE + +## Setting Up + +Install FXML from [here](https://gluonhq.com/products/javafx/) and extract it in the directory behind `EsotericProject` + +## Running + +To compile, simply run `make`. Then to run: + +`java --module-path ..\..\..\javafx-sdk-17.0.1\lib\ --add-modules javafx.controls,javafx.fxml IDE.HelloApplication` + +## Editors? + +If you got intellisense and stuff to work in vscodium, well done, coz I couldn't do that :3 + +### IntelliJ + +I hate IntelliJ but its the only way I could get a working intellisense. Right click on this folder and select 'Open Folder as an IntelliJ IDEA Community Edition Project', then follow [this](https://openjfx.io/openjfx-docs/#install-javafx) guide (select 'JavaFX and IntelliJ' in the website sidebar).
\ No newline at end of file diff --git a/src/UI/.gitkeep b/src/UI/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/src/UI/.gitkeep +++ /dev/null |