diff --git a/out/production/hurlers/sample/Controller.class b/out/production/hurlers/sample/Controller.class index 1a0efd475a3846ad55573e2c70260ef39678d3f4..4dc8c622e986e953a9242896baff54510f369fb5 100644 Binary files a/out/production/hurlers/sample/Controller.class and b/out/production/hurlers/sample/Controller.class differ diff --git a/out/production/hurlers/sample/Main.class b/out/production/hurlers/sample/Main.class index e1118a1cb68ba5b595b5b6770f447ba3e97245b5..967acb36f53db4d39038f97651fb26fd4e9266a4 100644 Binary files a/out/production/hurlers/sample/Main.class and b/out/production/hurlers/sample/Main.class differ diff --git a/out/production/hurlers/sample/sample.fxml b/out/production/hurlers/sample/sample.fxml index 3ff8d298b8189846a0481d81326678c3c9e4ca40..98a7c2ef3192a5b9067a5b3bfb33e8a76e33ce52 100644 --- a/out/production/hurlers/sample/sample.fxml +++ b/out/production/hurlers/sample/sample.fxml @@ -6,14 +6,14 @@ <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.text.Text?> -<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="498.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1"> +<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="498.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="sample.Controller" xmlns:fx="http://javafx.com/fxml/1"> <children> - <Button layoutX="100.0" layoutY="423.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="129.0" text="Submit thought" /> - <TextArea layoutX="59.0" layoutY="299.0" prefHeight="106.0" prefWidth="307.0" promptText="Write your thought here..." /> + <Button id="submitButton" layoutX="100.0" layoutY="423.0" mnemonicParsing="false" onAction="#handleSubmit" prefHeight="35.0" prefWidth="129.0" text="Submit thought" /> + <TextArea id="textBox" fx:id="textArea" layoutX="59.0" layoutY="299.0" prefHeight="106.0" prefWidth="307.0" promptText="Write your thought here..." /> <Text layoutX="65.0" layoutY="31.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Your thoughts" /> <ScrollPane layoutX="1.0" layoutY="40.0" prefHeight="258.0" prefWidth="700.0"> <content> - <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Text" wrappingWidth="33.22460746765137" /> + <Text id="thoughtId" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" wrappingWidth="33.22460746765137" /> </content> </ScrollPane> </children> diff --git a/src/sample/Controller.java b/src/sample/Controller.java index 54e5bd1a2ed51dacb653746fa480715b1da5dc8b..85c8337fcc46daf4c4bbf0bf5a0f467e225a7767 100644 --- a/src/sample/Controller.java +++ b/src/sample/Controller.java @@ -1,4 +1,28 @@ package sample; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.scene.control.TextArea; + public class Controller { + + @FXML + private TextArea textArea; + + @FXML + private void handleSubmit() { + System.out.println("Mamma sønn"); + + String tmp = ""; + tmp = textArea.getText(); + + System.out.println(tmp); + + //Thought tmpThought = new Thought(); + + + + // Button was clicked, do something... + //outputTextArea.appendText("Button Action\n"); + } } diff --git a/src/sample/Main.java b/src/sample/Main.java index 39e0c1866302df4481fb50384436e6ea840e608e..81ca8bba9823ab49abe8a8bf992aa79cebf27b2b 100644 --- a/src/sample/Main.java +++ b/src/sample/Main.java @@ -14,6 +14,8 @@ public class Main extends Application { primaryStage.setTitle("Hurl your thoughts"); primaryStage.setScene(new Scene(root, 700, 498)); primaryStage.show(); + + } diff --git a/src/sample/sample.fxml b/src/sample/sample.fxml index d7677ae6c8004d7c7b6a841637e63c8420bc4d90..98a7c2ef3192a5b9067a5b3bfb33e8a76e33ce52 100644 --- a/src/sample/sample.fxml +++ b/src/sample/sample.fxml @@ -6,10 +6,10 @@ <?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.text.Text?> -<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="498.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1"> +<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="498.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="sample.Controller" xmlns:fx="http://javafx.com/fxml/1"> <children> - <Button id="submitButton" layoutX="100.0" layoutY="423.0" mnemonicParsing="false" prefHeight="35.0" prefWidth="129.0" text="Submit thought" /> - <TextArea id="textBox" layoutX="59.0" layoutY="299.0" prefHeight="106.0" prefWidth="307.0" promptText="Write your thought here..." /> + <Button id="submitButton" layoutX="100.0" layoutY="423.0" mnemonicParsing="false" onAction="#handleSubmit" prefHeight="35.0" prefWidth="129.0" text="Submit thought" /> + <TextArea id="textBox" fx:id="textArea" layoutX="59.0" layoutY="299.0" prefHeight="106.0" prefWidth="307.0" promptText="Write your thought here..." /> <Text layoutX="65.0" layoutY="31.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Your thoughts" /> <ScrollPane layoutX="1.0" layoutY="40.0" prefHeight="258.0" prefWidth="700.0"> <content>