Exercise: Creating the Chatclient GUI, Part 3 (Level 1)
                   
In this exercise, you will enhance the GUI for a chat room application. You will complete
the GUI for the ChatClient
               
by adding a Choice component and two menus.
               
Figure 12-1 shows the GUI design taht you will attempt to achieve.
Figure 12-1 GUI Layout fot the ChatClient Application
                   
You will need to add three features to the existing GUI:
- Add the username Choice component under the Send and Quit buttons. This component enables
you to select a name that is posted with every chat line that you enter. You must alter the Send
button and TextField listeners to write the username options including your full name and a few
nicknames, such as Grand Poobah or Java Geek.
-
Add the File menu. This menu must include a Quit menu item that terminates the program when selected.
-
(Optional) Add the Help menu. This menu must include an About menu item that pops up simple
dialog box, wich displays a comment about the program and about you, the developer.
Preparation
Before you begin, make sure that you have changed directories to:
projects/ChatRoomPrj
using the cd command in the terminal window.
cd ~/projects/ChatRoomPrj/
Task 1 - Modifying the ChatClient Program
-
Using a text editor, modify the ChatClient source file in the project directory.
This classes must implement the GUI design in Figure 12-1 on page Lab 12-2.
Task 2 - Compiling the ChatClient Program
-
On the command line, use the javac command to compile the ChatClient program.
Task 3 - Running the ChatClient Program.
-
On the command line, use the java command to run the ChatClient program. You should
see the GUI shown in Figure 12-1. If your GUI does not look exactly like the figure, then edit the
code to tweak the design to match this figure.