Exercise

To extend your knowledge of the subjects covered today, try the following exercise.

  1. Create a chat room application. Participants provide their name and can send messages. Participants read messages posted by all other participants.

To assist you in this task, three Java files have been provided in the exercise sub-directory for Day 9 on the accompanying Web site.

The Chat.java and ChatDisplay.java files are complete and need not be edited. These files provide the Swing code to enter and display the chat room messages on the screen.

The TopicServer.java is a starting point for you to further develop the chat server. The initial code simply uses the callback method addMessage to bounce the message back to the screen. The addMessage method ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.