A simple image chat client written for ticklet 1* of the Part IB Further Java course.
Write a client which connects to a server and sends and receives images in JPEG format.
Your program should have the following features:
- It should contain a class called
ImageChatClient
which extendsJFrame
. ImageChatClient
must contain a constructor which takes the name of the server as aString
and the port number to connect to as anint
.- When an object of type
ImageChatClient
is instantiated it should create a Swing GUI with an AWTCanvas
object to render images sent by the server, and an AWTButton
with the text label "Upload". - If the
Button
object is clicked, you should create and show an instance of theJFileChooser
class. Your program should send the bytes representing the JPEG file selected by the user to the server over aSocket
object. - Clicking on the close button in the corner of the Swing window should close the application.