Added javafx part to main client test, instructions are in comments in the code

This commit is contained in:
Sem van der Hoeven
2019-02-18 16:20:46 +01:00
parent 3cd673b59e
commit fd350cf9bb
3 changed files with 68 additions and 1 deletions

View File

@@ -8,9 +8,9 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
@@ -23,5 +23,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="OOPP 43 In the beginning there was_/src/Main.java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

11
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"configurations": [
{
"type": "java",
"name": "CodeLens (Launch) - Main",
"request": "launch",
"mainClass": "Main",
"projectName": "OOP-Project"
}
]
}

View File

@@ -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<ActionEvent>() {
//
// @Override
// public void handle(ActionEvent event) {
// System.out.println("Hello World!");
// }
// });
//
// Button btn2 = new Button();
// btn2.setText("Say something else!");
// btn2.setOnAction(new EventHandler<ActionEvent>() {
// @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);
// }
//}