Hey, new to programming let alone java, and need help understanding this;
so i have a program that simulates a shopping cart, everytime i enter information into JTextFields which in turn gets to be args for a Person object I create, i can return values from Person variables to be what I entered originally into the JTextField, however in a subclass of this parent class, I only get null values when i try to return the values of the variables of that object... for example:

here is some of the code:
jbtOK.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Person customer1 = new Person(nameField.getText(), addressField.getText());
input.setCustomer(customer1);// ----new debug
System.out.println(customer1.getName() + " ShoppingCartGUI_Test.java anonymous listener");


and here is the output on the console:
Brian getName()
Brian setCustomer()
Brian getName()
Brian ShoppingCartGUI_Test.java anonymous listener


all of this was in the ShoppingCartGUI_Test.java, in my ShoppingCartGUI.java i have:

finish.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("FINISH BUTTON"); // For Debugging
System.out.println(input.toString());


I even added some output statements to the toString method for the object "input" which is of the ShoppingCart class, it creates its own customer that was shown to be set with the "customer1" successfully threw my output to console statements, but here is some of the toString:

public String toString(){
NumberFormat fmt = NumberFormat.getCurrencyInstance();

String contents = "";
contents += customer.getName() + "\n This should be BRIAN\n";
contents += customer.getAddress() + "\n This should be WHITE";

HOWEVER, this is the output on the console:

FINISH BUTTON
null getName()
null
This should be BRIAN
null
This should be WHITE

(I entered Brian in the text field for name and White in the text field for address....mostly because I got tired of putting in random long addresses.)

But WHY does this happen???:confused: