From fd350cf9bb865c4ec20621e944ed2c9343926051 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 18 Feb 2019 16:20:46 +0100 Subject: [PATCH] Added javafx part to main client test, instructions are in comments in the code --- .classpath | 3 +- .vscode/launch.json | 11 ++++ .../src/Main.java | 55 +++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json diff --git a/.classpath b/.classpath index 5e8a55f..2112843 100644 --- a/.classpath +++ b/.classpath @@ -8,9 +8,9 @@ + - @@ -23,5 +23,6 @@ + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1d433ce --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "configurations": [ + { + "type": "java", + "name": "CodeLens (Launch) - Main", + "request": "launch", + "mainClass": "Main", + "projectName": "OOP-Project" + } + ] +} \ No newline at end of file diff --git a/OOPP 43 In the beginning there was_/src/Main.java b/OOPP 43 In the beginning there was_/src/Main.java index e1704db..6f1149b 100644 --- a/OOPP 43 In the beginning there was_/src/Main.java +++ b/OOPP 43 In the beginning there was_/src/Main.java @@ -1,5 +1,60 @@ +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; + +//MAIN CLIENT + public class Main { public static void main(String[] args){ + System.out.print("Hello World!"); } } + +//COMMENT THE "MAIN CLIENT" PART OUT AND UNCOMMENT THE "JAVAFX" PART TO TEST IF JAVAFX WORKS +//Don't uncomment the imports pls :) + +//JAVAFX + +//public class Main extends Application { +// +// @Override +// public void start(Stage primaryStage) { +// Button btn = new Button(); +// btn.setText("Say 'Hello World'"); +// btn.setOnAction(new EventHandler() { +// +// @Override +// public void handle(ActionEvent event) { +// System.out.println("Hello World!"); +// } +// }); +// +// Button btn2 = new Button(); +// btn2.setText("Say something else!"); +// btn2.setOnAction(new EventHandler() { +// @Override +// public void handle(ActionEvent event) { +// System.out.println("something else!"); +// } +// }); +// +// StackPane root = new StackPane(); +// //apparently root.getchildren.add does the same as document.ready in javascript +// root.getChildren().add(btn); +// +// Scene scene = new Scene(root, 500, 250); +// +// primaryStage.setTitle("Hello World!"); +// primaryStage.setScene(scene); +// primaryStage.show(); +// } +// +// public static void main(String[] args) { +// launch(args); +// } +//}