private void intiInterface()
    {
        // -----------  ------------//
        JPanel northPanel = new JPanel();
        northPanel.add(titleLab);
        northPanel.setBackground(Color.white);

        // ---------- вʾ ----------//
        JPanel centerPanel = new JPanel(new BorderLayout());
        // message
        chatContentPanel = new ChatPanel();
        JScrollPane msgScrollPane = new JScrollPane(chatContentPanel);
        msgScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        msgScrollPane.setBorder(new TitledBorder("Message"));

        // center south panel ( tool bar + input )
        JPanel centerSouthPanel = new JPanel(new BorderLayout());
        inputFont = new Font(null, Font.PLAIN, 12);
        controllToolbar = new ControllToolbar();
        inputTA = new JTextArea(4, 0);
        inputTA.setAutoscrolls(true);
        JScrollPane inputScroll = new JScrollPane(inputTA);
        inputScroll.setBorder(new TitledBorder("Input"));
        inputScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        centerSouthPanel.setBackground(Color.white);
        centerSouthPanel.add(controllToolbar, BorderLayout.NORTH);
        centerSouthPanel.add(inputScroll, BorderLayout.SOUTH);
        inputTA.setLineWrap(true);
        inputTA.addKeyListener(new KeyAdapter()
        {
            @Override
            public void keyReleased(KeyEvent e)
            {
                // Ctrl + enter 
                if (e.isControlDown() && e.getKeyCode() == KeyEvent.VK_ENTER)
                {
                    inputTA.setText(inputTA.getText() + "\n");
                }

                // enter 
                else if (!e.isControlDown() && e.getKeyCode() == KeyEvent.VK_ENTER)
                {
                    sendMsgBtn.doClick();
                    e.setKeyChar('\0');
                }
            }
        });

        centerPanel.add(msgScrollPane, BorderLayout.CENTER);
        centerPanel.add(centerSouthPanel, BorderLayout.SOUTH);

        msgScrollPane.setBackground(Color.white);
        inputScroll.setBackground(Color.white);
        centerPanel.setBackground(Color.white);

        // ----------- Ϸť ------------//
        JPanel southPanel = new JPanel();
        sendMsgBtn = new JButton("Send");
        closeBtn = new JButton("Close");
        sendMsgBtn.setActionCommand("send");
        sendMsgBtn.addActionListener(this);
        closeBtn.setActionCommand("close");
        closeBtn.addActionListener(this);
        southPanel.add(sendMsgBtn);
        southPanel.add(closeBtn);
        southPanel.setBackground(Color.white);

        // ----------- ͼƬ------------//
//        JPanel eastPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));

        // ------------------ ------------------------//
        this.getContentPane().setBackground(Color.white);
        this.getContentPane().setLayout(new BorderLayout());
        this.getContentPane().add(northPanel, BorderLayout.NORTH);
        this.getContentPane().add(centerPanel, BorderLayout.CENTER);
        this.getContentPane().add(southPanel, BorderLayout.SOUTH);

        this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); // Ĭϵرհťʱ˳
        this.setMinimumSize(new Dimension(550, 500));
        this.setSize(550, 500);
        Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
        this.setLocation((screenDim.width - 550) / 2, (screenDim.height - 500) / 2); // Ļ
        
        // ӹر¼
        addWindowListener(new WindowAdapter()
        {
            @Override
            public void windowClosed(WindowEvent e)
            {
                eixtCurrentChat(); 
            }
        });
    }