Skip to content
Snippets Groups Projects
Commit 33f604fd authored by Herman Andersen Dyrkorn's avatar Herman Andersen Dyrkorn
Browse files

adding deletebutton and function to handle delete all

parent 0e895796
No related branches found
No related tags found
1 merge request!17Resolve "delete all thoughts"
......@@ -24,6 +24,15 @@ public class Controller {
tm.add(t);
tm.displayList();
}
public void handleHurlAll() {
//get the thought manager
ThoughtManager tm = ThoughtManager.getInstance();
//delete all thoughts and display the list
tm.hurl();
tm.displayList();
}
}
......@@ -7,7 +7,7 @@
<?import javafx.scene.text.Font?>
<?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" fx:controller="sample.Controller">
<AnchorPane id="hurlAllThoughts" 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" fx:controller="sample.Controller">
<children>
<Button id="submitButton" layoutX="83.0" layoutY="432.0" mnemonicParsing="false" onAction="#handleSubmit" prefHeight="35.0" prefWidth="129.0" text="Submit thought" />
<TextArea id="textBox" fx:id="textArea" layoutX="58.0" layoutY="316.0" prefHeight="106.0" prefWidth="307.0" promptText="Write your thought here..." />
......@@ -19,7 +19,7 @@
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="256.0" prefWidth="701.0">
<children>
<Text id="thoughtId" fill="#755252" layoutX="37.0" layoutY="36.0" strokeType="OUTSIDE" strokeWidth="20.0" text="Text" wrappingWidth="48.55792045593262">
<Text id="thoughtId" fill="#755252" layoutX="37.0" layoutY="36.0" strokeType="OUTSIDE" strokeWidth="20.0" text="Text" wrappingWidth="500">
<font>
<Font size="14.0" />
</font>
......@@ -28,5 +28,6 @@
</AnchorPane>
</content>
</ScrollPane>
<Button layoutX="531.0" layoutY="10.0" mnemonicParsing="false" onAction="#handleHurlAll" text="Hurl all your thoughts" />
</children>
</AnchorPane>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment