Example usage for javax.swing Action MNEMONIC_KEY

List of usage examples for javax.swing Action MNEMONIC_KEY

Introduction

In this page you can find the example usage for javax.swing Action MNEMONIC_KEY.

Prototype

String MNEMONIC_KEY

To view the source code for javax.swing Action MNEMONIC_KEY.

Click Source Link

Document

The key used for storing an Integer that corresponds to one of the KeyEvent key codes.

Usage

From source file:Main.java

public ShowAction() {
    super("About");
    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.SMALL_ICON, MetalIconFactory.getFileChooserHomeFolderIcon());
}

From source file:Main.java

public ShowAction() {
    super("About");

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.LARGE_ICON_KEY, MetalIconFactory.getFileChooserHomeFolderIcon());

}

From source file:Main.java

public ShowAction() {
    super("About");

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.DISPLAYED_MNEMONIC_INDEX_KEY, 1);

}

From source file:Main.java

public ShowAction() {
    super("About");
    PropertyChangeListener lis = new PropertyChangeListener() {
        @Override/*from   w  w  w .java 2s .c o  m*/
        public void propertyChange(PropertyChangeEvent e) {
            System.out.println(e);
        }
    };
    addPropertyChangeListener(lis);

    putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_A));
    putValue(Action.NAME, "Go to number ");
    putValue(Action.LONG_DESCRIPTION, "Change the number to ");

    removePropertyChangeListener(lis);

}

From source file:ca.sfu.federation.action.ShowHelpWebSiteAction.java

public ShowHelpWebSiteAction() {
    super("Online Help Documents", null);
    this.putValue(Action.LONG_DESCRIPTION, "Online Help Documents");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_H);
    this.putValue(Action.SHORT_DESCRIPTION, "Online Help Documents");
}

From source file:ca.sfu.federation.action.CreateScenarioAction.java

public CreateScenarioAction() {
    super("Create Scenario", null);
    Icon icon = ImageIconUtils.loadIconById("model-create-scenario");
    this.putValue(Action.LONG_DESCRIPTION, "Create Scenario");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_S);
    this.putValue(Action.SHORT_DESCRIPTION, "Create Scenario");
    this.putValue(Action.SMALL_ICON, icon);
}

From source file:Main.java

public ExitAction(String name) {
    super(name);/*from www.java  2 s. co  m*/
    this.putValue(Action.MNEMONIC_KEY, exitKey.getKeyCode());
    this.putValue(Action.ACCELERATOR_KEY, exitKey);
}

From source file:ca.sfu.federation.action.CreateAssemblyAction.java

public CreateAssemblyAction() {
    super("Create Assembly", null);
    Icon icon = ImageIconUtils.loadIconById("model-create-assembly");
    this.putValue(Action.LONG_DESCRIPTION, "Create Assembly");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_A);
    this.putValue(Action.SHORT_DESCRIPTION, "Create Assembly");
    this.putValue(Action.SMALL_ICON, icon);
}

From source file:ca.sfu.federation.action.CreateComponentAction.java

public CreateComponentAction() {
    super("Create Componnet", null);
    Icon icon = ImageIconUtils.loadIconById("model-create-component");
    this.putValue(Action.LONG_DESCRIPTION, "Create Component");
    this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_C);
    this.putValue(Action.SHORT_DESCRIPTION, "Create Component");
    this.putValue(Action.SMALL_ICON, icon);
}

From source file:com.sshtools.common.ui.NewWindowAction.java

/**
 * Creates a new NewWindowAction object.
 *
 * @param application//from w ww . j  a  va  2s.  co m
 */
public NewWindowAction(SshToolsApplication application) {
    this.application = application;

    putValue(Action.NAME, "New Window");
    putValue(Action.SMALL_ICON, getIcon("/com/sshtools/common/ui/newwindow.png"));
    putValue(LARGE_ICON, getIcon("/com/sshtools/common/ui/largenewwindow.png"));
    putValue(Action.SHORT_DESCRIPTION, "Create new window");
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.ALT_MASK));
    putValue(Action.LONG_DESCRIPTION, "Create a new SSHTerm window");
    putValue(Action.MNEMONIC_KEY, new Integer('w'));
    putValue(Action.ACTION_COMMAND_KEY, "new-window");
    putValue(StandardAction.ON_MENUBAR, new Boolean(true));
    putValue(StandardAction.MENU_NAME, "File");
    putValue(StandardAction.MENU_ITEM_GROUP, new Integer(0));
    putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(90));
    putValue(StandardAction.ON_TOOLBAR, new Boolean(true));
    putValue(StandardAction.TOOLBAR_GROUP, new Integer(0));
    putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(90));
}