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() { //create new thought, parameter from textArea Thought t = new Thought(textArea.getText()); //clear textArea textArea.clear(); //get the thought manager and add the thought to the manager ThoughtManager tm = ThoughtManager.getInstance(); 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(); } }