I'm calling a textField box with input in the box via a button but it is returning an empty string. Here is the same code;

```
Panel Class
    //creates the textField
    panel1.add(text.getfname());

Class TextBoxes 

public JTextField getfname(){   
    JTextField fname = new JTextField(80);
    fname.setBounds( 100, 100, 150, 20 );
    fname.setSize(200,30);
    return fname;

    }

```

And class where the textField is called

```
TextBoxes text = new TextBoxes();
String fname = text.getfname().getText();

```

I'm just a little puzzled