If you need to keep a reference to all these TextFields you can store them in an array.
How do I now read the data that has been entered into the fields
You need a reference to the textfield to be able to call its methods.
One way to have references to all the textfields is to save the references. For example in an array or in a collection of some type, say a Map.
If there are multiple textfields how do you know what is in each textfield? How do you associate a textfield with the data that is in it?
When should the program get data from a textfield? Does the user cause an event to tell the program its time to get the data? For example by pressing a button or by pressing Enter when focus is in the textfield.
How do I save the textfield name to fetch it?
You do not save the variable name. You save a reference to the textfield in an ArrayList. Use the add() method to save the reference and the get() method to retrieve the reference.
Line 11 will not work
Please explain what "not work" means.
I am lost with the add and get method. Can you show me an example using this code so that line 8 will print out the text I enter in the text fields created in the loop?
I appreciate your help and patience working with a greenhorn...
Ok. The compiler sees that. Not sure what that code is intended to do.
I have not defined them properly.
I am lost with the add and get method.
Start by reading the API doc for the ArrayList class: http://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html
Also the tutorial: http://docs.oracle.com/javase/tutorial/collections/interfaces/list.html
A small example of an ArrayList:
My problem is how do i get a reference to the textfield so that I can fetch the value entered by the user.
The for loop adds the textfields to the gridpane.
the format entry trys to get the text the user has entered and print it out.
how do i get a reference to the textfield
Define an ArrayList at the class level so that it was in scope where it was being accessed.
In the loop that creates the textfields and adds them to the GUI, also add the textfield reference to the ArrayList.
Later When you want to get the references to the textfields, in a loop call the ArrayList's get method to get the references to the textfields.