function = ((KeyDescription)functions.getSelectedValue()).toString();
if (functions.getSelectedValue() instanceof Macro) { function = ((Macro)functions.getSelectedValue()).toString(); } else function = ((KeyDescription)functions.getSelectedValue()).toString();
   private void mapIt() {      Object[]      message = new Object[1];      JPanel kgp = new JPanel();      final KeyGetter kg = new KeyGetter();      kg.setForeground(Color.blue);      message[0] = kgp;      String function;      if (functions.getSelectedValue() instanceof String)         function = (String)functions.getSelectedValue();      else         function = ((KeyDescription)functions.getSelectedValue()).toString();      kg.setText(LangTool.getString("key.labelMessage") +                        function);      kgp.add(kg);      String[] options = new String[1];      options[0] = LangTool.getString("key.labelClose");      JPanel kp = new JPanel();      JOptionPane opain = new JOptionPane(message,                        JOptionPane.PLAIN_MESSAGE,                        JOptionPane.DEFAULT_OPTION,        // option type                        null,                        options,                        options[0]);      dialog = opain.createDialog(this, getTitle());      // add window listener to the dialog so that we can place focus on the      //   key getter label instead of default and set the new key value when      //   the window is closed.      dialog.addWindowListener(new WindowAdapter() {         boolean gotFocus = false;         public void windowClosed(WindowEvent we) {            setNewKeyStrokes(kg.keyevent);         }         public void windowActivated(WindowEvent we) {            // Once window gets focus, set initial focus to our KeyGetter            //    component            if (!gotFocus) {               kg.grabFocus();               gotFocus = true;            }         }      });      dialog.setVisible(true);   }