Chat

The Chat program is composed by a server and a graphic client. The chat service has to be able to attend multiple graphic clients at the same time. The client is implemented using the Swing Graphic library. The server should be able to have, at least, 10 rooms for conversations. The clients should be able to create new rooms. If there are more than 10 rooms already, an empty room is deleted. If there are no empty rooms, an error message is shown to the user.

The chat client should allow, at least, the following commands in its UI:

Commands:
  list              List the names of all rooms.
  nickname <name>   Gives a name for the user.
  join <room name>  Joins a room.
  \                 Leaves a room (only command
                    possible inside a room).

Events that should be broadcasted for all room members:

     New user enters room.
    Whatever a user types.
    User leaves room.

Examples:

   User hotair enters room pingpong.
  User niceperson: Welcome hotair !
  User hotair: Hi.
  ...
  User hotair: I don't like you, niceperson.
  User hotair leaves room pingpong.