01: package tijmp.actions;
02:
03: import java.awt.event.ActionEvent;
04: import javax.swing.AbstractAction;
05: import javax.swing.JFrame;
06:
07: /** An action that closes and disposes a frame.
08: */
09: public class FrameCloser extends AbstractAction {
10: private JFrame f;
11:
12: public FrameCloser(JFrame f) {
13: super ("Close");
14: this .f = f;
15: }
16:
17: public void actionPerformed(ActionEvent e) {
18: f.dispose();
19: }
20: }
|