title: JPopupMenu know which JMenuItem are clicked
body: <p>my question in very simple. I have a <code>JPopupMenu</code> that shown two <code>JMenuItem</code>. The only way I have found to know which item are clicked using </p>
  
  <pre><code>class MenuActionListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
      System.out.println("Selected: " + e.getActionCommand());    
    }
  }
  </code></pre>
  
  <p>but the command <code>e.getActionCommand()</code> print the text inside the item. I would like get an index <code>from 0 to n</code> to known which item are clicked and not the text (that can be modified).
  Is it possible ?</p>