Skip to content
Snippets Groups Projects

Resolve "appending textview to thoughts"

Merged Herman Andersen Dyrkorn requested to merge 15-appending-textview-to-thoughts into master
2 files
+ 11
11
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 9
11
@@ -2,6 +2,8 @@ package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.control.TextArea;
public class Controller {
@@ -9,6 +11,9 @@ public class Controller {
@FXML
private TextArea textArea;
@FXML
private ListView<String> listView;
@FXML
private void handleSubmit() {
@@ -18,21 +23,14 @@ public class Controller {
//clear textArea
textArea.clear();
//get the thought manager and add the thought to the manager
ThoughtManager tm = ThoughtManager.getInstance();
tm.add(t);
tm.displayList();
//add the thoughts to the lists
listView.getItems().addAll(t.getThought());
listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
}
public void handleHurlAll() {
//get the thought manager
ThoughtManager tm = ThoughtManager.getInstance();
//delete all thoughts and display the list
tm.hurl();
tm.displayList();
listView.getItems().clear();
}
}
Loading