package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.text.Text; import javafx.stage.Stage; import java.net.ContentHandlerFactory; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); primaryStage.setTitle("Hurl your thoughts"); Scene sceneMain = new Scene(root, 700, 498); primaryStage.setScene(sceneMain); //get access to the text field: ScrollPane scrollyPlane = (ScrollPane) sceneMain.lookup("#scrollyboi"); Node content = scrollyPlane.getContent(); Text ourTextField = (Text) content.lookup("#thoughtId"); ThoughtManager tm = ThoughtManager.getInstance(); //NOTE! if you reinitalize ThoughtManager it will just change where it will be writing to: tm.initialize(ourTextField); tm.makeList(); primaryStage.show(); } public static void main(String[] args) { launch(args); } }