Command.java |
package cutils.reflection; /** * This class uses the command pattern to * implement a button. * @author D. Lyon * @version 1.0 */ public class Command implements java.awt.event.ActionListener, Runnable { private javax.swing.AbstractButton ab; public Command(javax.swing.AbstractButton _ab) { ab = _ab; ab.addActionListener(this); } public javax.swing.AbstractButton getButton() { return ab; } public void actionPerformed(java.awt.event.ActionEvent e) { run(); } public void run() { } }