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)
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 http://www.tfh-berlin.de/~ischmied/Inf1/Demos/chatcode.jar, 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 ChatClient.java, 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:
· 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 18.104.22.168 to 22.214.171.124. 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.
· 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.
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.