Example #1
0
 public void secureMove() {
   int rw = tblItems.getSelectedRow();
   if (rw == -1) {
     JOptionPane.showMessageDialog(frm, "No item selected", "Error", JOptionPane.ERROR_MESSAGE);
     return;
   }
   int idx = tblItems.convertRowIndexToModel(rw);
   String[] opts = new String[storeLocs.size()];
   for (int i = 0; i < opts.length; i++) opts[i] = storeLocs.get(i).getAbsolutePath();
   JComboBox cmbMove = new JComboBox(opts);
   cmbMove.setSelectedIndex(store.curStore(idx));
   if (JOptionPane.showConfirmDialog(frm, cmbMove, "Move item", JOptionPane.OK_CANCEL_OPTION)
       != JOptionPane.OK_OPTION) return;
   File newLoc = store.move(idx, cmbMove.getSelectedIndex());
   if (newLoc == null) System.err.println("move " + store.plainName(idx) + " unsuccessful");
   else needsSave = true;
 }
Example #2
0
 @Override
 public void actionPerformed(ActionEvent e) {
   // TODO Auto-generated method stub
   if (e.getSource() == b1) {
     int index = box.getSelectedIndex();
     String column = "";
     if (index == 0) column = "ename";
     else if (index == 1) column = "hiredate";
     else column = "deptno";
     String data = tf.getText().trim();
     if (data.length() < 1) {
       tf.requestFocus();
       return;
     }
     getFindData(column, data);
   }
   if (e.getSource() == b2) {
     getData();
   }
 }
 /** Reaction to buttons and combo boxes. */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   if (cmdCtrlProp.equals(cmd)) {
     try {
       Class c =
           Class.forName("aurora.hwc.control.Panel" + myController.getClass().getSimpleName());
       AbstractPanelController cp = (AbstractPanelController) c.newInstance();
       cp.initialize(myController, null);
     } catch (Exception ex) {
     }
   }
   if (cmdCtrlList.equals(cmd)) {
     JComboBox cb = (JComboBox) e.getSource();
     if (cb.getSelectedIndex() > 0) {
       myController = (AbstractControllerComplex) listCControllers.getSelectedItem();
       buttonProp.setEnabled(true);
     } else {
       buttonProp.setEnabled(false);
       myController = null;
     }
     myMonitor.setMyController(myController);
   }
   return;
 }
 private void cbSpelRondeItemStateChanged(ItemEvent evt) {
   int i = cbSpelRonde.getSelectedIndex();
   SpelersCombo(i);
 } // private void cbSpelRondeItemStateChanged(ItemEvent evt)