@Override
        public void actionPerformed(ActionEvent e)
        {
            String actionStr = e.getActionCommand();
            switch (actionStr)
            {
                case "SetFontBlod":
                {
                    // ԭǴ
                    if (inputFont.isBold())
                    {
                        // ԭб
                        if (inputFont.isItalic())
                        {
                            // ĳֻб
                            inputFont = new Font(inputFont.getFamily(), Font.ITALIC, inputFont.getSize());
                        } else
                        {
                            // ĳ style
                            inputFont = new Font(inputFont.getFamily(), Font.PLAIN, inputFont.getSize());
                        }
                    }
                    // ԭǴ
                    else
                    {
                        // ԭб
                        if (inputFont.isItalic())
                        {
                            // ĳɴб
                            inputFont = new Font(inputFont.getFamily(), Font.ITALIC | Font.BOLD, inputFont.getSize());
                        } else
                        {
                            // ĳֻǴ
                            inputFont = new Font(inputFont.getFamily(), Font.BOLD, inputFont.getSize());
                        }
                    }

                    // Ӧõ
                    inputTA.setFont(inputFont);

                    break;
                }

                case "SetFontItalic":
                {
                    // ԭб
                    if (inputFont.isItalic())
                    {
                        // ԭǴ
                        if (inputFont.isBold())
                        {
                            // ĳֻǴ
                            inputFont = new Font(inputFont.getFamily(), Font.BOLD, inputFont.getSize());
                        } else
                        {
                            // ĳ style
                            inputFont = new Font(inputFont.getFamily(), Font.PLAIN, inputFont.getSize());
                        }
                    }
                    // ԭб
                    else
                    {
                        // ԭǴ
                        if (inputFont.isBold())
                        {
                            // ĳɴб
                            inputFont = new Font(inputFont.getFamily(), Font.ITALIC | Font.BOLD, inputFont.getSize());
                        } else
                        {
                            // ĳֻб
                            inputFont = new Font(inputFont.getFamily(), Font.ITALIC, inputFont.getSize());
                        }
                    }

                    // Ӧõ
                    inputTA.setFont(inputFont);

                    break;
                }

                case "SaveRecords":
                {
                    try
                    {
                        // ѡ񱣴·
                        FileDialog saveRecordsFD;
                        if (isSingleChat)
                        {
                            saveRecordsFD = new FileDialog(CommonData.getChatUserMap().get(targetUser), "Save Records",
                                    FileDialog.SAVE);
                        } else
                        {
                            saveRecordsFD = new FileDialog(CommonData.getGroupChatFrame(), "Save Records",
                                    FileDialog.SAVE);
                        }
                        saveRecordsFD.setFile("records.html"); // ñ
                        saveRecordsFD.setVisible(true);
                        if (saveRecordsFD.getDirectory() == null)
                        {
                            break;
                        }

                        // д¼ļ
                        String recordPath = saveRecordsFD.getDirectory() + saveRecordsFD.getFile();
                        RandomAccessFile raf = new RandomAccessFile(new java.io.File(recordPath), "rw");
                        byte[] recordsArray = chatRecordsStr.getBytes();
                        raf.write(recordsArray);
                        raf.close();

                    } catch(FileNotFoundException e1)
                    {
                        e1.printStackTrace();
                    } catch(IOException e1)
                    {
                        e1.printStackTrace();
                    }

                    break;
                }

                case "SendExpression":
                {
                    ExpressionPanel expressionPanel = new ExpressionPanel();
                    JDialog dialog = new JDialog();
                    dialog.setUndecorated(true);
                    dialog.setModal(false);
                    dialog.getContentPane().add(expressionPanel, BorderLayout.CENTER);
                    dialog.setSize(200, 150);
                    int x = ((JButton)e.getSource()).getLocation().x + controllToolbar.getLocation().x + parentFrame.getLocation().x;
                    int y = (parentFrame.getLocation().y + parentFrame.getSize().height) - 370;
                    dialog.setLocation(x, y);
                    dialog.setVisible(true);
                    
                    // ñʧȥ͹ر
                    dialog.addWindowFocusListener(new WindowAdapter()
                    {
                        public void windowLostFocus(WindowEvent e)
                        {
                            ((JDialog)e.getSource()).dispose();
                        };
                    });
                    
                    break;
                }
                default:
                    break;
            }
        }