Project #9

Due Tuesday, April 27

Modify the client that I wrote in class to include two radio buttons, one for connecting to an echo server and the other to connect to a web server. Add an additional (regular-style) button to clear the displayTextBox area.

Note: YOU WILL NOT BE USING THREADS FOR THIS ASSIGNMENT.

When the "echo server" radio button is selected and the user types a string in the inputTextBox, send the string to an echo server (use woody4.cs.uiowa.edu -- port number 7). Retrieve the string back from the echo server and display it in the displayTextBox area. (Your code should look very similar to the code I wrote to connect to the server. Put your code in the event handler that is called whenever the user hits the return key inside the inputTextBox.)

When the "web server" radio button is selected and the user types a string in the inputTextBox (e.g., http://www.cs.uiowa.edu/index.html), send the string to the specified web server. The "base address" for the web server is the string up to the last "/". The file name to retrieve is everything after the last "/". Adapt the code from example 14.1, pages 568-569. You will only need the first few lines of that program. The response from the web server should be placed in the displayTextBox. The code to do this part should also be placed in the event handler that is called whenever the user hits the return key inside the inputTextBox.

When the user clicks the "Clear List Box" button, clear the displayTextBox area.