Пример #1
0
 void placeOrder(final User user, String cmd, Company comp, int qty, int id) {
   int cmdID = commID++;
   connect(user.getName(), user.getPassword());
   try {
     out.println(cmdID + ";" + cmd + ":" + comp.name + ":" + Integer.toString(qty) + ":" + id);
     out.flush();
     Shares pen = (Shares) receiveReply(cmdID);
     user.getPendingShares().add(pen);
     user.dataChanged();
   } catch (Exception r) {
     r.printStackTrace();
   }
 }
Пример #2
0
  private void button3_updateActionPerformed(ActionEvent e) {
    String message = null;
    User temp = (User) list1.getSelectedValue();
    try {
      temp.name = textField1_name.getText();
      temp.emeil = textField2_emeil.getText();
      temp.telefon = Integer.valueOf(textField3_telefon.getText());
      message = "Успешно преобразован";
      textField1_name.setText("");
      textField2_emeil.setText("");
      textField3_telefon.setText("");

    } catch (NumberFormatException ex) {
      message = "Разберитесь с телефоном";
    } finally {
      JOptionPane.showMessageDialog(this, message);
    }
  }