Description
Earnings: 5% of your total course mark
Purpose: Building a Client GUI
The purpose of Assignment #2 is to build a simple socket based client/server application. In Part 1 of the assignment you are to build the client GUI. In Part 2 of the assignment you are to write the client and the server code. The server will be a multithreaded TUI type application.
Problem Specification:
In this part of Assignment #2 you are to build a relatively simple GUI for the Client Application. Your GUI must have exactly the same appearance as the one shown in Fig. 1 and Fig. 2 below:
Fig. 1. The Client Swing GUI at launch.
Fig. 2. The Client Swing GUI with Combo Box opened.
Requirements:
The initial and the minimum size of the resizable frame is (610,550).
The combo box and the Connect button have the same size.
The text fields and the combo box must have white backgrounds and must be editable. The displayed text must be left aligned.
The preferred size of the Host: label is (40,20) and the Port: label is (40,40).
All buttons must have mnemonic.
The Send button must be disabled at launch and must have the same height as the adjacent text area. The text area must display the specified text at launch.
The labels must have mnemonic and when the corresponding Alt-Key is pressed the focus must be transferred to the corresponding test field or combo box.
At launch the host text field must has the focus (the insertion caret (cursor) must be blinking at the beginning of the text field in front of the latter l of the localhost.
The CONNECTION panel must have a red titled round line border.
The CLIENT REQUEST panel must have a blue titled line border.
The TERMINAL panel must have a black titled round line border with centered title. The terminal text area must not be editable.
The frame title must contain your name.
No event handling is required for this part of the assignment but for the second part you will need an event handler implementing the ActionListener interface. The GUI creation code must be placed in a class named ClientView.java. The GUI must be instantiated and made visible in a class named Client.java (this class must contain only a main method).
Tasks:
Build the Client GUI. You can use Swing API or JavaFX API. You are also allowed to use GUI building tools. If you use Swing API, the GUI must look exactly the same as the GUI shown in Fig. 1. and Fig. 2. above. If you use JavaFX, API the GUI must look exactly the same as the GUI shown in Fig. 3. and Fig. 4. at the end of the document (page 4). If you decide to use JavaFX or GUI building tools, talk to me before you start. The GUI screenshots have been taken under Windows with the default “look and feel.”
What to Submit:
No electronic submission is required for this part of Assignment #2 but you have to demonstrate you working Client GUI during the first 90 minutes of your Lab period during week 11 of the semester.
Marking Scheme:
5 marks – The Client GUI must meet all requirements and must look exactly the same as the one shown in Fig. 1 and 2.
4 marks – The Client GUI looks exactly the same as the one shown in Fig. 1 and 2 but does not meet two of the requirements.
3 marks – The Client GUI has all of the required components but they are not properly aligned and sized, or the GUI does not meet three or more requirements.
0 marks – The Client GUI is missing a component.
1 mark – Bonus: Make the host text field resizable so that when the GUI is resized its size changes as well. All other components (except the text area) must keep their original size.
Enjoy the assignment. And do not forget that
“To have a server you ought to have a client first.” Business Rule #1
Fig. 3. The Client JavaFX GUI at launch.
Fig. 4. The Client JavaFX GUI with Combo Box opened.
Reviews
There are no reviews yet.