private ActionListener createInviteListener() {
        // create a dialog to let user input ip, port and invitation type
        return new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                PeerStatus status = LocalInfo.getPeerStatus();
                if (!(status == PeerStatus.STARTER || status == PeerStatus.INVITEE)) {
                    JOptionPane.showMessageDialog(frame, "You have no authority to do that");
                    return;
                }
                // send invitation to specific ip and port
                String ipPort = JOptionPane.showInputDialog("Please input ip:port");
                if (ipPort == null)
                    return;
                String[] strs = ipPort.split(":");
                if (strs.length != 2) {
                    JOptionPane.showMessageDialog(null, "Invalid Format of Ip and Port",
                            "Error!", JOptionPane.ERROR_MESSAGE);
                    return;
                }
                try {
                    LocalSender.sendInvitationMsg(strs[0], Integer.parseInt(strs[1]),
                            Event.INVITATION);
                    System.out.println("Invite server to network: " + strs[0] + ":" + strs[1]);
                } catch (Exception exception) {
                    exception.printStackTrace();
                }
            }
        };
    }