functions = new JList(lm);     functions.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { setKeyDescription(functions.getSelectedIndex()); } } });  loadList(LangTool.getString("key.labelKeys"));  functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane functionsScroll = new JScrollPane(functions);  JPanel fp = new JPanel();  JComboBox whichKeys = new JComboBox(); whichKeys.addItem(LangTool.getString("key.labelKeys")); whichKeys.addItem(LangTool.getString("key.labelMacros")); whichKeys.addItem(LangTool.getString("key.labelSpecial"));  whichKeys.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {  JComboBox cb = (JComboBox)e.getSource(); loadList((String)cb.getSelectedItem()); } });  fp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelDesc"))); fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS));  fp.add(whichKeys); fp.add(functionsScroll);  strokeDesc.setColumns(30); strokeDesc.setBackground(functions.getBackground()); strokeDesc.setEditable(false);  strokeDescAlt.setColumns(30); strokeDescAlt.setBackground(functions.getBackground()); strokeDescAlt.setEditable(false);  JPanel dp = new JPanel(); dp.setBorder(BorderFactory.createTitledBorder( LangTool.getString("key.labelMapTo")));  dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS));  JPanel primeKeyPanel = new JPanel();  primeKeyPanel.add(strokeDesc);  addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime", primeKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime", primeKeyPanel,true);  JPanel altKeyPanel = new JPanel(); altKeyPanel.add(strokeDescAlt);  addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt", altKeyPanel,true); addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt", altKeyPanel,true);  dp.add(primeKeyPanel); dp.add(altKeyPanel);
   void jbInit() throws Exception {      // create some reusable borders and layouts      BorderLayout borderLayout = new BorderLayout();      mapper = new KeyMapper();      mapper.init();      functions = new JList(lm);      // add list selection listener to our functions list so that we      //   can display the mapped key(s) to the function when a new      //   function is selected.      functions.addListSelectionListener(new ListSelectionListener() {         public void valueChanged(ListSelectionEvent lse) {            if (!lse.getValueIsAdjusting()) {               setKeyDescription(functions.getSelectedIndex());            }         }      });      loadList(LangTool.getString("key.labelKeys"));      functions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);      JScrollPane functionsScroll = new JScrollPane(functions);      JPanel fp = new JPanel();      JComboBox whichKeys = new JComboBox();      whichKeys.addItem(LangTool.getString("key.labelKeys"));      whichKeys.addItem(LangTool.getString("key.labelMacros"));      whichKeys.addItem(LangTool.getString("key.labelSpecial"));      whichKeys.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                JComboBox cb = (JComboBox)e.getSource();                loadList((String)cb.getSelectedItem());            }        });      fp.setBorder(BorderFactory.createTitledBorder(                                    LangTool.getString("key.labelDesc")));      fp.setLayout(new BoxLayout(fp,BoxLayout.Y_AXIS));      fp.add(whichKeys);      fp.add(functionsScroll);      strokeDesc.setColumns(30);      strokeDesc.setBackground(functions.getBackground());      strokeDesc.setEditable(false);      strokeDescAlt.setColumns(30);      strokeDescAlt.setBackground(functions.getBackground());      strokeDescAlt.setEditable(false);      JPanel dp = new JPanel();      dp.setBorder(BorderFactory.createTitledBorder(                                    LangTool.getString("key.labelMapTo")));      dp.setLayout(new BoxLayout(dp,BoxLayout.Y_AXIS));      JPanel primeKeyPanel = new JPanel();      primeKeyPanel.add(strokeDesc);      addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Prime",                                       primeKeyPanel,true);      addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Prime",                                       primeKeyPanel,true);      JPanel altKeyPanel = new JPanel();      altKeyPanel.add(strokeDescAlt);      addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP-Alt",                                       altKeyPanel,true);      addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE-Alt",                                       altKeyPanel,true);      dp.add(primeKeyPanel);      dp.add(altKeyPanel);      keyPanel.setLayout(borderLayout);      keyPanel.add(fp,BorderLayout.WEST);      keyPanel.add(dp,BorderLayout.CENTER);      // add the panels to our dialog      getContentPane().add(keyPanel,BorderLayout.CENTER);      getContentPane().add(options, BorderLayout.SOUTH);      // add option buttons to options panel//      addOptButton(LangTool.getString("key.labelMap","Map Key"),"MAP",options,true);//      addOptButton(LangTool.getString("key.labelRemove","Remove"),"REMOVE",options,true);      addOptButton(LangTool.getString("key.labelDone","Done"),"DONE",options,true);      this.setModal(true);      this.setTitle(LangTool.getString("key.title"));      // pack it and center it on the screen      pack();      Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();      Dimension frameSize = getSize();      if (frameSize.height > screenSize.height)         frameSize.height = screenSize.height;      if (frameSize.width > screenSize.width)         frameSize.width = screenSize.width;      setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);      // now show the world what we can do      show();   }