map.put((KeyStroke)e.getNewValue(), "doClick");
KeyStroke accelerator = (KeyStroke) e.getNewValue(); if (accelerator != null) map.put(accelerator, "doClick");
    public void propertyChange(PropertyChangeEvent e)    {      if (e.getPropertyName() == "accelerator")        {          InputMap map = SwingUtilities.getUIInputMap(menuItem, JComponent.WHEN_IN_FOCUSED_WINDOW);          if (map != null)            map.remove((KeyStroke)e.getOldValue());          else            map = new ComponentInputMapUIResource(menuItem);          map.put((KeyStroke)e.getNewValue(), "doClick");        }    }