Demo I wrote in response to a student request for how to have
multiple listeners (Bobs) that are already on-screen added as listeners
to a newly-created pushbutton (Fred).
Bob b1 = new Bob();
b1.setVisible(true);
Bob b2 = new Bob();
b2.setVisible(true);
ActionListener[] bobs = { b1, b2};
Fred f1 = new Fred(bobs);
f1.setVisible(true);