else if (e.getPropertyName().equals("displayedMnemonic")) {  JLabel label = (JLabel) e.getSource(); if (label.getLabelFor() != null) { int oldMnemonic = ((Integer) e.getOldValue()).intValue(); int newMnemonic = ((Integer) e.getNewValue()).intValue(); InputMap keyMap = label.getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW); keyMap.put(KeyStroke.getKeyStroke(oldMnemonic, KeyEvent.ALT_DOWN_MASK), null); keyMap.put(KeyStroke.getKeyStroke(newMnemonic, KeyEvent.ALT_DOWN_MASK), "press"); } } else if (e.getPropertyName().equals("labelFor")) { JLabel label = (JLabel) e.getSource(); InputMap keyMap = label.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); int mnemonic = label.getDisplayedMnemonic(); if (mnemonic > 0) keyMap.put(KeyStroke.getKeyStroke(mnemonic, KeyEvent.ALT_DOWN_MASK), "press"); }
  public void propertyChange(PropertyChangeEvent e)  {    if (e.getPropertyName().equals("text"))      {        String text = (String) e.getNewValue();        JLabel l = (JLabel) e.getSource();        BasicHTML.updateRenderer(l, text);      }  }