use of the form input
Hi,
I have a class Manager and a class ManagerGUI. I have formatted the code so that it is more readable.
My ManagerGUI class looks somehting like this-
publicclass ManagerGUIextends JFrame
{
String name;
JPanel namePanel;
JTextField nameInput;
JLabel nameLabel;
Manager empAgent;
ManagerGUI(Manager ea)
{
super(ea.getLocalName());
empAgent = ea;
//make the name panel and add it to the topPanel.
addListeners();
getContentPane().add(topPanel, BorderLayout.CENTER);
setResizable(false);
}//end constructor.
publicvoid show()
{
pack();
super.setVisible(true);
}
void addListeners()
{
nameInput.addActionListener(new NameL());
}
class NameLimplements ActionListener
{
publicvoid actionPerformed(ActionEvent e)
{
nameE = nameInput.getText();
}
}
}//end class ManagerGUI.
I have tried to seperate it out so that any changes can be easily implemented (although it perhaps is a long way of doing things).
Now I have a class Manager that wants to call the GUI and then process the information got from the text field.
I use the following lines to call the GUI class.
manGui =new ManagerGUI(this);
manGui.show();
I want to use the variablenameE in the Manager. How can I do that?
Thanks.

