Component c = l.getLabelFor(); if (c != null) { int mnemonic = l.getDisplayedMnemonic(); if (mnemonic > 0) {  InputMap keyMap = new InputMap(); keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.VK_ALT), "press"); SwingUtilities.replaceUIInputMap(l, JComponent.WHEN_IN_FOCUSED_WINDOW, keyMap);   ActionMap map = new ActionMap(); map.put("press", new AbstractAction() { public void actionPerformed(ActionEvent event) { JLabel label = (JLabel) event.getSource(); Component c = label.getLabelFor(); if (c != null) c.requestFocus(); } }); SwingUtilities.replaceUIActionMap(l, map); } }
  protected void installKeyboardActions(JLabel l)    throws NotImplementedException  {    //FIXME: implement.  }