コード例 #1
0
 public static void showDialog(JDialog parent) {
   try {
     JDialog dialog = new ReceiveAddressDialog(parent);
     dialog.pack();
     dialog.setLocationRelativeTo(parent);
     dialog.setVisible(true);
   } catch (Exception exc) {
     ErrorLog.logException("Exception while displaying dialog", exc);
   }
 }
コード例 #2
0
 @Override
 public void actionPerformed(ActionEvent ae) {
   try {
     String action = ae.getActionCommand();
     if (action.equals("done")) {
       setVisible(false);
       dispose();
     } else if (action.equals("new")) {
       ECKey key = new ECKey();
       editKey(key, -1);
     } else {
       int row = table.getSelectedRow();
       if (row < 0) {
         JOptionPane.showMessageDialog(
             this, "No entry selected", "Error", JOptionPane.ERROR_MESSAGE);
       } else {
         row = table.convertRowIndexToModel(row);
         switch (action) {
           case "copy":
             String address = (String) tableModel.getValueAt(row, 1);
             StringSelection sel = new StringSelection(address);
             Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
             cb.setContents(sel, null);
             break;
           case "edit":
             ECKey key = BTCLoader.keys.get(row);
             editKey(key, row);
             break;
         }
       }
     }
   } catch (BlockStoreException exc) {
     ErrorLog.logException("Unable to update blockStore database", exc);
   } catch (Exception exc) {
     ErrorLog.logException("Exception while processing action event", exc);
   }
 }