Ejemplo n.º 1
0
 public void actionPerformed(ActionEvent e) {
   Object s = e.getSource();
   if (s instanceof JButton && (JButton) s == okButton) {
     commit();
     endDialog();
   } else if (s instanceof JButton && (JButton) s == cancelButton) {
     if (VncViewer.nViewers == 1)
       if (cc.viewer instanceof VncViewer) {
         ((VncViewer) cc.viewer).exit(1);
       }
     ret = false;
     endDialog();
   } else if (s instanceof JButton && (JButton) s == optionsButton) {
     options.showDialog(getJDialog());
   } else if (s instanceof JButton && (JButton) s == aboutButton) {
     VncViewer.showAbout(getJDialog());
   } else if (s instanceof JComboBox && (JComboBox) s == server) {
     if (e.getActionCommand().equals("comboBoxEdited")) {
       server.insertItemAt(editor.getItem(), 0);
       server.setSelectedIndex(0);
     }
   }
 }