FileDocCategorySizeDatePackage
MultiListeners.javaAPI DocExample978Fri Dec 28 23:18:22 GMT 2001None

MultiListeners

public class MultiListeners extends Object
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).

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

 
		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);