cp.add(addPetB); cp.add(doneOutputB); rect.setVisible(true); cbHandler = new AddPetButtonHandler(); ebHandler = new DoneOutputButtonHandler(); addPetB.addActionListener(cbHandler); doneOutputB.addActionListener(ebHandler); } //Instatiates driver method public static void main(String[] args) { PetInput ArE = new PetInput(); ArE.driver(); //lines edited to meet JavaRanch restrictions on abbreviations } private class AddPetButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { petName = String.parseString(nameTF.getText()); petAge = Int.parseInt(ageTF.getText()); petGender = //not sure how to store gender petInfo.add(petName); petInfo.add(petAge); petInfo.add(petGender); }
ArrayList<Pet> pets = new ArrayList<Pet>(); Pet next = new Pet("Doberman", 12, 'M'); pets.add(next); // etc.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)