private void btn_loginActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btn_loginActionPerformed // TODO add your handling code here: char[] p = pwd.getPassword(); Agent agentClient = null; pass = new String(p); agentId = tx_agent.getText(); iface = tx_iface.getText(); queueId = listQueue.get(cb_queue.getSelectedIndex()).getQueueId(); queueName = listQueue.get(cb_queue.getSelectedIndex()).getQueueName(); agentObject.setAgentId(agentId); agentObject.setPass(pass); agentObject.setInterface(iface); agentObject.setRole(role); agentObject.setQueueId(queueId); agentObject.setQueueName(queueName); lb_notify_queue.setText(""); lb_notify_iface.setText(""); lb_notify_pwd.setText(""); lb_notify_agent.setText(""); try { // kiem tra thong tin nguoi dung nhap vao if (!agentId.equalsIgnoreCase("") && uti.checkAgent(agentId)) { if (!pass.equalsIgnoreCase("") && uti.checkPwd(pass)) { if (!iface.equalsIgnoreCase("") && uti.checkIface(iface)) { if (!queueId.equalsIgnoreCase("")) { cmd = "100@" + agentId + "@" + pass + "@SIP/" + iface + "@" + queueId + "@" + role; lb_status.setText(cmd); Socket clientSocket = new Socket(host, aport); if (clientSocket != null) { System.out.println("connect to server " + clientSocket.getInetAddress().toString()); agentClient = new Agent(clientSocket, this); } } else lb_notify_queue.setText("(*)"); } else lb_notify_iface.setText("(*)"); } else lb_notify_pwd.setText("(*)"); } else lb_notify_agent.setText("(*)"); } catch (Exception e) { System.out.println("btn_loginActionPerformed\t" + e); } } // GEN-LAST:event_btn_loginActionPerformed