1 4 package org.webdocwf.util.loader.wizard; 5 6 import java.awt.Toolkit ; 7 import java.awt.event.ActionEvent ; 8 9 import javax.swing.AbstractAction ; 10 import javax.swing.ImageIcon ; 11 import javax.swing.JOptionPane ; 12 import javax.swing.KeyStroke ; 13 14 19 public class ShowHelpAction extends AbstractAction { 20 21 24 public ShowHelpAction() { 25 putValue(NAME, "Help"); 26 putValue( 27 SMALL_ICON, 28 new ImageIcon ( 29 getClass().getClassLoader().getResource( 30 "org/webdocwf/util/loader/" + "wizard/images/Help16.gif"))); 31 putValue(SHORT_DESCRIPTION, "Help for running the program"); 32 putValue(LONG_DESCRIPTION, "Help for running the program"); 33 putValue( 34 ACCELERATOR_KEY, 35 KeyStroke.getKeyStroke( 36 'H', 37 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); 38 putValue(MNEMONIC_KEY, new Integer ('H')); 39 } 40 41 45 public void actionPerformed(ActionEvent e) { 46 try { 47 OctopusGeneratorHelpFrame helpFrame = new OctopusGeneratorHelpFrame(); 48 helpFrame.setIconImage( 49 new ImageIcon ( 50 getClass().getClassLoader().getResource( 51 "org/webdocwf/util/loader/" + "wizard/images/Enhydra16.gif")) 52 .getImage()); 53 helpFrame.setVisible(true); 54 } catch (Exception ex) { 55 String message = "Error while creating Help button : " + ex.getMessage(); 56 JOptionPane.showMessageDialog(null, message + "\n", "Error", 0); 57 System.exit(0); 58 } 59 } 60 61 } 62 | Popular Tags |