I currently have 3 classes, a main class containing a GUI, and the fnameTxtField, a customer class containing the data, and a customerList class which gathers the data from the customer class, and puts it into an array list.
I currently have 3 classes, a main class containing a GUI, and the fnameTxtField
Share
Where you are using
fnameTxtField.getText, Java is expecting you to declare a method parameter (kind of like declaring a variable). A parameter is information that your method is told about for one particular execution, instead of having to find out on its own.So you are right in thinking you want something like this:
Then at the point of invocation (method call) specify that you want to use the value in your text field: