public boolean start(){
          display("Connecting to the server...");

        try {
            socket = new Socket(server, port);
        } catch (IOException e) {
            display("Error: Error on connecting to the server... " + e.getMessage());
            System.out.println(e.getMessage());
            e.printStackTrace();
            return false;
        }
        String msg = "Connection accepted " + socket.getInetAddress() + ":" + socket.getPort();
        display(msg);

        try {
            input = new ObjectInputStream(socket.getInputStream());
            output = new ObjectOutputStream(socket.getOutputStream());
        } catch (IOException e) {
            display("Error: Exception on creating input/output streams: " + e.getMessage());
            return false;
        }

        // creates the Thread to listen from the server
        new ListenFromServer().start();

        try {
            output.writeObject(username);
        } catch (IOException e) {
            display("Error: Exception establishing connection to the server... " + e.getMessage());
            disconnect();
            return false;
        }

        String conmsg = "You are now connected to the server!";
        display(conmsg);
        return true;
    }