title: Action and ActionMap - Explain me this behavior
body: <p>I have an <code>Action</code></p>
  
  <pre><code>SampleAction a = new SampleAction("foo", null);
  </code></pre>
  
  <p>Then I add it to a Button, and to an ActionMap </p>
  
  <pre><code>JButton b = new JButton(a);
  b.getActionMap().put("bar", a);
  b.getInputMap().put(KeyStroke.getKeyStroke("F1"), "bar");
  </code></pre>
  
  <p>I put a trace (<code>System.out.println("Action [" + e.getActionCommand() + "] performed!");</code>) inside the Action. When I press the button with mouse it shows</p>
  
  <pre><code>Action [foo] performed!
  </code></pre>
  
  <p>But when i use <kbd>F1</kbd>, it shows:</p>
  
  <pre><code>Action [null] performed!
  </code></pre>
  
  <p>Why?</p>
  
  <hr>
  
  <pre><code>class SampleAction extends AbstractAction
  {
      public SampleAction(String text, Icon icon) {
          super(text, icon);
      }
  
      @Override
      public void actionPerformed(ActionEvent e) {
          System.out.println("Action [" + e.getActionCommand() + "] performed!");
      }
  }
  </code></pre>