Example usage for javax.swing Action NAME

List of usage examples for javax.swing Action NAME

Introduction

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

Prototype

String NAME

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

Click Source Link

Document

The key used for storing the String name for the action, used for a menu or button.

Usage

From source file:CutPasteSample.java

private static Action findAction(Action actions[], String key) {
    Hashtable<Object, Action> commands = new Hashtable<Object, Action>();
    for (int i = 0; i < actions.length; i++) {
        Action action = actions[i];
        commands.put(action.getValue(Action.NAME), action);
    }//w  ww.j a  va 2  s. c o m
    return commands.get(key);
}

From source file:ColorAction.java

public ColorAction(String name, Icon icon, Color c, Component comp) {
    putValue(Action.NAME, name);
    putValue(Action.SMALL_ICON, icon);
    putValue("Color", c);
    target = comp;//from   w  w w.  j  a  va2  s  . c o m
}

From source file:Main.java

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

    putValue(Action.ACTION_COMMAND_KEY, "command");
    putValue(Action.NAME, "Go to number ");

}

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.SHORT_DESCRIPTION, "Change the number to ");
    super.setEnabled(false);
}

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.SHORT_DESCRIPTION, "Change the number to ");

}

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.SHORT_DESCRIPTION, "Change the number to ");
    super.setEnabled(false);
    System.out.println(super.isEnabled());
}

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.LONG_DESCRIPTION, "Change the number to ");
    super.setEnabled(false);
    System.out.println(super.isEnabled());
}

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.LONG_DESCRIPTION, "Change the number to ");

    System.out.println(super.getValue(Action.NAME));
}

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.SELECTED_KEY, true);

}

From source file:Main.java

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

    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("A"));
    putValue(Action.NAME, "Go to number ");

}