//The First program: CreateElephantListener.java
package lab4;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import lab4lib.Elephant;
import lab4lib.WindowWithButtons;
public class CreateElephantListener implements ActionListener {
private WindowWithButtons _windowWithButtons;
public CreateElephantListener(WindowWithButtons windowWithButtons) {
_windowWithButtons = windowWithButtons;
}
public void actionPerformed(ActionEvent ag0) {
Elephant elephant;
elephant
= new Elephant();
_windowWithButtons.add(elephant);
}
}
|