Assignment-06

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

Up ] Assignment-01a ] Assignment-01b ] Assignment-01c ] Assignment-01d ] Assignment-02 ] Assignment-02a ] Assignment-03 ] Assignment-03a ] Assignment-03b ] Assignment-03c ] Assignment-03d ] Assignment-04 ] Assignment-04a ] Assignment-04b ] Assignment-05 ] [ Assignment-06 ] Assignment-07 ]

Writing a Java client/server application

  1. You may choose to design your own client/server application. This will include a Java server program that runs on a port (of your choice) on osprey7 and a client applet.
  2. or try one of the following ideas:
    Adapt the tic-tac-toe example in the Deitel book to play a different game between 2 client applets.
    Write a chat application that allows two or more users to type in text that everyone can see. The applet interface should allow a user to register a "chat name" with the server and then have an interface with at least a textfield for typing and a larger text area where everyone's text appears. This is a little more involved as you must design a protocol for the client applet to communicate with the server. Whenever a user types in text and hits return or enter, the applet will send the text to the server. The server then broadcasts the text and chatname to everyone so that all applets append this new text to all the other messages in the textarea. If you have time, you can easily think of other enhancements such as the applet interface shows the names of all registered users, a list of prepared short messages to send when selected, and so on.
    Write a file manager server. Suppose that your server has a directory of files to manage. Client applets could find out what files there are and use a text area to save text into a new file or to display the contents of an existing file. There is a class FileDialog which you could use for the file dialog interface or you can design your own. For example, here are two screendumps of a Font/Desk accessory mover that was designed to copy files from a hard drive to a floppy. You could adapt this kind of user interface to copying from a list of files on the server machine to just one textarea on the applet, or vice versa.