import java.awt.event.*; public class KontovisningTekst implements ActionListener { private Kontomodel model; public KontovisningTekst(Kontomodel model1) { model = model1; model.addActionListener(this); // registrér som lytter på modellen } public void actionPerformed(ActionEvent hændels) { // getActionCommand() giver beskrivelsen af hændelsen System.out.println("Konto "+model.getEjer()+": "+hændels.getActionCommand()); System.out.println("Konto "+model.getEjer()+": Saldo er: "+model.getSaldo()); } }