KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > JButtonMappedAction


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4  
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7  
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9  
10    $Log: JButtonMappedAction.java,v $
11    Revision 1.1 2004/03/31 08:16:40 bobintetley
12    Code clean up and separating out of JButtonMappedAction class
13
14  
15  */

16
17 package swingwtx.swing;
18
19 import swingwt.awt.event.*;
20
21 /**
22  * Utility class - maps a JButton and Action together.
23  *
24  * Used by JToolBar/JButton when linking toolbar items
25  * together.
26  *
27  * @author Robin Rawson-Tetley
28  */

29 class JButtonMappedAction extends AbstractAction {
30     
31     JButton button = null;
32     
33     public JButtonMappedAction(JButton b) {
34         button = b;
35     }
36     public void actionPerformed(ActionEvent e) {
37         button.processActionEvent(0);
38     }
39     public JButton getJButton() { return button; }
40     
41 }
Popular Tags