saving data from multiple JTextFields...
I am creating a program for myself to manage my bills/account information. When I click on a button "create new account" another window will pop up, with a text box for account name, address, and any other important information. I am just wondering if I need to have an action listener for each text field, or if it is possible to have my save button use an action listener that will somehow store the date from each JTextField into the proper area.
Below is an example of the text fields. I am thinking that I might have to have a different name for each text field, rather than reusing the same textField and textFieldLabel. Any input is appreciated.
-dub stylee
JPanel accountInfoPanel =new JPanel(new GridBagLayout());
accountInfoPanel.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Add New Account"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)));
textField =new JTextField(25);
textFieldLabel =new JLabel("Creditor Name:");
textFieldLabel.setLabelFor(textField);
c.gridx = 0;
c.gridy = 0;
accountInfoPanel.add(textFieldLabel, c);
c.gridx = 1;
accountInfoPanel.add(textField, c);
textField =new JTextField(25);
textFieldLabel =new JLabel("Address Line 1:");
textFieldLabel.setLabelFor(textField);
c.gridx = 0;
c.gridy = 1;
accountInfoPanel.add(textFieldLabel, c);
c.gridx = 1;
accountInfoPanel.add(textField, c);

