aboutsummaryrefslogtreecommitdiff
path: root/src/main/jfxTest.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-05-06 14:56:46 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-05-06 14:56:46 -0400
commit372d97fee538f86c8333fbbde43cf51484b8ac67 (patch)
tree055f5560e58d4a83a90a3e1c46ec8d998e12a96f /src/main/jfxTest.java
parentcee3ca3fec021c0ddf8f3ee66940bb1cdfba4262 (diff)
downloadNPEhero-372d97fee538f86c8333fbbde43cf51484b8ac67.tar.gz
NPEhero-372d97fee538f86c8333fbbde43cf51484b8ac67.tar.bz2
NPEhero-372d97fee538f86c8333fbbde43cf51484b8ac67.zip
Add JavaFX and seperate source and class files
Diffstat (limited to 'src/main/jfxTest.java')
-rw-r--r--src/main/jfxTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main/jfxTest.java b/src/main/jfxTest.java
new file mode 100644
index 0000000..9552946
--- /dev/null
+++ b/src/main/jfxTest.java
@@ -0,0 +1,35 @@
+package main;
+
+import javafx.application.Application;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.layout.StackPane;
+import javafx.stage.Stage;
+
+public class jfxTest extends Application {
+ public static void main(String[] args) {
+ launch(args);
+ }
+
+ @Override
+ public void start(Stage primaryStage) {
+ primaryStage.setTitle("Hello World!");
+ Button btn = new Button();
+ btn.setText("Say 'Hello World'");
+ btn.setOnAction(new EventHandler<ActionEvent>() {
+
+ @Override
+ public void handle(ActionEvent event) {
+ System.out.println("Hello World!");
+ }
+ });
+
+ StackPane root = new StackPane();
+ root.getChildren().add(btn);
+ primaryStage.setScene(new Scene(root, 300, 250));
+ primaryStage.show();
+
+ }
+} \ No newline at end of file