KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > jdnc > actions > PrintAction


1 /*
2  * $Id: PrintAction.java,v 1.1.1.1 2004/06/16 01:43:40 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.jdnc.actions;
9
10 import java.net.URL JavaDoc;
11
12 import javax.swing.Action JavaDoc;
13 import javax.swing.Icon JavaDoc;
14 import javax.swing.ImageIcon JavaDoc;
15
16 import org.jdesktop.swing.actions.TargetableAction;
17
18 public class PrintAction extends TargetableAction {
19
20     private final static Icon JavaDoc defaultIcon;
21
22     static {
23         URL JavaDoc url = PrintAction.class.getResource("/toolbarButtonGraphics/general/Print24.gif");
24         defaultIcon = url == null ? null : new ImageIcon JavaDoc(url);
25     }
26
27     public PrintAction() {
28         this("Print", "print", defaultIcon);
29     }
30
31     public PrintAction(String JavaDoc name, String JavaDoc id, Icon JavaDoc icon) {
32         super(name, id, icon);
33         putValue(Action.SHORT_DESCRIPTION, name);
34     }
35 }
36
Popular Tags