public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();
    if (source.equals(input)) {
      String line = input.getText().trim();
      if (line.length() > 0) { 
        if (line.charAt(0) == '/') { 
          mainFrame.parseCmd(line);
          resetLine();
          addCmdToHistory(line); // save command
        } else { 
          conn.doPrivmsg(name,line);
          updateText(line, mainFrame.getOwnColor(), true);
          resetLine();
          addCmdToHistory(line); // save command
        }
      }
    } else if (source.equals(part) && mainFrame.isConnected()) {
      mainFrame.closePanel(name);
    }
  }