@Override
    public void actionPerformed(ActionEvent e)
    {
        String actionStr = e.getActionCommand();
        switch (actionStr)
        {
            case "send":
            {
                String inputText = inputTA.getText().trim();
                String fontStyle = "";
                fontStyle += inputFont.isBold() ? ("font-weight:bold;") : "";
                fontStyle += inputFont.isItalic() ? ("font-style:italic;") : "";
                String chatContent = "<span style='font-size:" + inputFont.getSize() + "px;" + fontStyle + "'>"
                        + inputText + "</span>";
                String formatContent = ""; // ʽ

                if (!chatContent.equals(""))
                {
                    // Ϣ
                    String sendMsg = "";

                    // ڸʽ
                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

                    // ȡǰϵͳʱ
                    String timeStr = df.format(new Date());

                    // ʽ
                    formatContent = "<html>" + "<font color = green>" + CommonData.getUserName() + "  " + timeStr
                            + " :</font><br>" + chatContent + "</html>";

                    // һһ
                    if (isSingleChat)
                    {
                        // ϢʽmsgType:::fromUser:::toUser:::formatContent
                        sendMsg = MessageTypeEnum.SingleChat.toString() + ":::" + CommonData.getUserName() + ":::"
                                + targetUser + ":::" + formatContent;

                    }
                    // Ⱥ
                    else
                    {
                        // ϢʽmsgType:::fromUser:::formatContent
                        sendMsg = MessageTypeEnum.GroupChat.toString() + ":::" + CommonData.getUserName() + ":::"
                                + formatContent;
                    }

                    // ݵ촰
                    addChatContent("<html><font color = blue>" + CommonData.getUserName() + " (me) :</font><br>"
                            + chatContent + "</html>");

                    // Ϣ
                    MainClientSocket.getMainSocket().getServerThread().sendData(sendMsg);

                    // 촰
                    inputTA.setText("");

                } else
                {
                    JOptionPane.showMessageDialog(this, "Can not send an empty message", "infor",
                            JOptionPane.INFORMATION_MESSAGE);
                    return;
                }

                break;
            }

            case "close":
            {
                eixtCurrentChat();
                break;
            }

            default:
                break;
        }
    }