Skip to content
Snippets Groups Projects
Controller.java 571 B
Newer Older
  • Learn to ignore specific revisions
  • 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() {
    
    
    Herman Andersen Dyrkorn's avatar
    Herman Andersen Dyrkorn committed
            //create new thought, parameter from textArea
            Thought t = new Thought(textArea.getText());
    
            //clear textArea
            textArea.clear();
    
    
    
    Herman Andersen Dyrkorn's avatar
    Herman Andersen Dyrkorn committed
            //get the thought manager and add the thought to the manager
    
            ThoughtManager tm = ThoughtManager.getInstance();
            tm.add(t);
    
    Eirik Martin Danielsen's avatar
    Eirik Martin Danielsen committed
            tm.displayList();