public static void main(String[] args) {
        TalkToMe ttm;
        if (args.length != 0 && args[0].equalsIgnoreCase("g")) {
            ttm = new TalkToMe(args);
            try {
                ttm.readFile(ttm.filename);
            } catch (Exception ex) {
                ttm.guiMode.setMsgToChat(ERROR_READ_FILE + ex);
                ttm.logWriteComp(ERROR_READ_FILE + ex);
            }
            ttm.guiMode.setMsgToChat(ttm.sayHello());
            ttm.logWriteComp(ttm.sayHello());

        } else {
            ttm = new TalkToMe("Console");
            try {
                ttm.readFile(ttm.filename);
            } catch (Exception ex) {
                System.err.println(ERROR_READ_FILE + ex);
                ttm.logWriteComp(ERROR_READ_FILE + ex);
            }
            ttm.answer(ttm.sayHello());
            ttm.talk();
            ttm.disconnect();
        }
    }