These exercises are about the GUI part of the fourth assignment and are intended to give you a start with its graphical user interface. Each exercise illustrates the solution with a screenshot of the required frame.
a). Open the project ReferenceGUIa, create an object of class ReferenceGUI and invoke its interact method. This class implements a basic GUI frame with very limited functionality (only a window with title and basic controls). Modify this class to create and show a menu bar with two menus labeled file and help. The file menu should appear to the left of the menu bar and the help to the right. The file menu has only one item, quit, and the help menu has also one item, about. These items should have associated action methods, the quit option has the quit() method which finishes the program and the about option has the showAbout() method which displays the program version. These action methods should be included through an action listener implemented using an anonymous inner class.
b). Create and show three buttons at the top of the main panel. These are the buttons associated with the different reference sources, should be labeled (from left to right) All, Java Glossary and c++ Glossary and don't need to have any associated action methods for now. Note that in order to create these buttons you will have to obtain the main window's content pane and include them at the top of this pane.
c). Create and add a search field to the right hand side of the three reference buttons (those from the previous exercise). This should be a text field that should be included as a field of the class and that has an associated action method termSearch() (which for the moment doesn't do anything).
d). Modify the termSearch() method to display a dummy definition for the text entered in the search field. The dummy definition should say something like "This is the definition for " and the entered text. The dummy definition should be displayed within the definition pane (a field of the class). This pane should be included in the center of the content pane.
e). Modify the termSearch() method to create and display a group of radio buttons (using the ButtonGroup and JRadioButton classes) to present alternative terms to the user. This group of buttons should be included in the results pane, a field of the class that should be added in the left hand side of the content pane. The alternative terms could be hard-coded (the same ones would appear regardless of the text entered by the user). Every time the user clicks on the radio buttons, a dummy definition will be displayed in the definition pane.
f). So far the similar terms and definitions have been simulated. Modify the project so that the ReferenceGUI class connects with and obtains similar terms and definitions from the glossary (only one glossary, say the Java glossary). In order to do this you will have to include the Glossary, Term, Lexicon and WordDistance classes to the project.