1 7 8 package org.jdesktop.jdnc.actions; 9 10 import java.net.URL ; 11 12 import javax.swing.Action ; 13 import javax.swing.Icon ; 14 import javax.swing.ImageIcon ; 15 import javax.swing.KeyStroke ; 16 17 import org.jdesktop.swing.actions.TargetableAction; 18 19 public class FindAction extends TargetableAction { 20 21 private final static Icon defaultIcon; 22 23 static { 24 URL url = FindAction.class.getResource("/toolbarButtonGraphics/general/Find24.gif"); 26 defaultIcon = url == null ? null : new ImageIcon (url); 27 } 28 29 public FindAction() { 30 this("Find", "find", defaultIcon); 31 } 32 33 public FindAction(String name, String id, Icon icon) { 34 super(name, id, icon); 35 putValue(Action.SHORT_DESCRIPTION, name); 36 putValue(Action.MNEMONIC_KEY, new Integer ('F')); 37 putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control F")); 38 } 39 } 40 | Popular Tags |