connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false);
showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true);  showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } });  options.add(showMe);  connectButton = addOptButton(LangTool.getString("ss.optConnect"), "CONNECT",options,false);  applyButton = addOptButton(LangTool.getString("ss.optApply"), "APPLY",options,true);
   void jbInit() throws Exception {      // make it non resizable      setResizable(true);      this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);      // create some reusable borders and layouts      Border etchedBorder = BorderFactory.createEtchedBorder();      BorderLayout borderLayout = new BorderLayout();      // get an instance of our table model      ctm = new ConfigureTableModel();      // create a table using our custom table model      sessions = new JTable(ctm);      // Add enter as default key for connect with this session      KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0);      sessions.registerKeyboardAction(new ActionListener() {            public void actionPerformed(ActionEvent e) {               doActionConnect();            }         },enter,JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);      sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);      sessions.setPreferredScrollableViewportSize(new Dimension(500,200));      sessions.setShowGrid(false);      //Create the scroll pane and add the table to it.      scrollPane = new JScrollPane(sessions);      scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);      scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);      //Setup our selection model listener      rowSM = sessions.getSelectionModel();          rowSM.addListSelectionListener(new ListSelectionListener() {              public void valueChanged(ListSelectionEvent e) {                  //Ignore extra messages.                  if (e.getValueIsAdjusting())                     return;                  ListSelectionModel lsm =                      (ListSelectionModel)e.getSource();                  if (lsm.isSelectionEmpty()) {                      //no rows are selected                     editButton.setEnabled(false);                     removeButton.setEnabled(false);                     connectButton.setEnabled(false);                  } else {                     int selectedRow = lsm.getMinSelectionIndex();                      //selectedRow is selected                     editButton.setEnabled(true);                     removeButton.setEnabled(true);                     connectButton.setEnabled(true);                  }              }          });      // setup the frame interface panel      interfacePanel = new JPanel();      TitledBorder tb = BorderFactory.createTitledBorder(                              LangTool.getString("conf.labelPresentation"));      interfacePanel.setBorder(tb);      ButtonGroup intGroup = new ButtonGroup();      intTABS = new JRadioButton(LangTool.getString("conf.labelTABS"));      intTABS.setSelected(true);      intTABS.addItemListener(new java.awt.event.ItemListener() {         public void itemStateChanged(ItemEvent e) {            intTABS_itemStateChanged(e);         }      });      intMDI = new JRadioButton(LangTool.getString("conf.labelMDI"));      // add the interface options to the group control      intGroup.add(intTABS);      intGroup.add(intMDI);      if (props.containsKey("emul.interface")) {         if (props.getProperty("emul.interface").equalsIgnoreCase("MDI"))            intMDI.setSelected(true);      }      interfacePanel.add(intTABS);      interfacePanel.add(intMDI);      //Setup panels      configOptions.setLayout(borderLayout);      sessionPanel.setLayout(borderLayout);      configOptions.add(sessionPanel, BorderLayout.CENTER);      sessionOpts.add(scrollPane, BorderLayout.CENTER);      sessionPanel.add(sessionOpts, BorderLayout.NORTH);      sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH);      sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder());      // add the option buttons      addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel);      removeButton = addOptButton(LangTool.getString("ss.optDelete"),                                    "REMOVE",                                    sessionOptPanel,                                    false);      editButton = addOptButton(LangTool.getString("ss.optEdit"),                                    "EDIT",                                    sessionOptPanel,                                    false);      connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false);      addOptButton(LangTool.getString("ss.optCancel"),"DONE",options);      // add the panels to our dialog      getContentPane().add(sessionPanel,BorderLayout.CENTER);      getContentPane().add(options, BorderLayout.SOUTH);      getContentPane().add(interfacePanel,BorderLayout.NORTH);      // 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);      // set default selection value as the first row      if (sessions.getRowCount() > 0) {         sessions.getSelectionModel().setSelectionInterval(0,0);      }      sessions.requestFocus();      // now show the world what we and they can do      this.setVisible(true);   }