Informatik 1 Schmiedecke

Lab X7b Chat


Do either X7a Calculator or X7b Chat or X7c - Autocomplete, whatever you like best!


In this final lab, you are going to put some of your programming skills together to write a little GUI application.


Objectives: Streams, GUIs and programming in general


You will need slides and downloads from Lect 15 (networking)


Lab Task:


You have seen our little chat running it works, but it is quite rudimentary!



Based on one of the chat demo applications, which you can download from, you are supposed to make up a more realistic and complete chat application. Try the multicast chat if you have problems running it, use the server chat. (Take care when unpacking the software: retain the folder structure, because both clients are called, but reside in different packages.)


Your task is to create several chatrooms or groups and offer the user a choice of a chatroom and a nickname, and also give the GUI a little polish:


  1. Provide a start screen, where the user can choose a user name and a chat room.

         Runnig two main windows (Frames) from the same thread does not work reliably so start your ChatClient in a sparate thread.

         For the multicast solution, remember that multicast group IPs range from to You can either allow the user to type in a group IP (error-prone), or pre-define a set of groups and offer them in a combo-box, identified by names.

         For the server solution, create groups by running several server instances listening to different ports.

         When the user closes the chat window, fall back to the start screen.


  1. On the chat screen, there are several improvements that you could make just choose one or two or invent your own add-ons:

         Identify the chat group in the caption.

         Add a time stamp to each message.

         Assign a colour to each user and print the messages in different colours. This means using the Graphics drawString method rather than adding lines to a TextArea. You may also surf the API to find TextDisplays that allow multi colour text in a more elegant way. You may either augment the server messages by a display colour, or do the colour bookkeeping inside the client.

         At one side of the frame, display a list of connected nicknames. Make sure to update it whenever a user connects or disconnects.



  1. Offer to save the chat contents when the user leaves.
  2. Add whispering allow a user to send a personal message to another user.
  3. Add a notification feature let your chat beep or show a popup window when a certain member, as specified by the user, enters the chat.




As this is your last lab in this course, I would be grateful if you could give me some feedback on how you got along with it (and me J), how much you invested and how much you got out, what can (or must) be improved, etc. Some of you have continually given me feedback in your lab reports; I appreciated that very much, criticism as much as praise.


As for me, I really enjoyed working with you and am looking forward to another term with you if things work out as planned.


Ilse Schmiedecke 2008 for questions and remarks