Submission date: 2000.02.11
In order to pass this coursework, you must submit and pass all questions.
Questions that require a program to be written should result in one or more files with a .java extension, all comments should be embedded in the files (with particular emphasis on documentation comments). Questions that require an essay to be written should result in a single file that is one of: a Word file (.doc extension), a FrameMaker file (.fm extension), a LATEX2e file (.ltx extension), an HTML file or a plain ASCII text file (.txt extension).
NB The intention behind the user interface programming exercises is to learn something about how Swing/AWT works. In a commercial production environment it is unlikely that the user interface would be coded directly, it is more likely that user interface construction tools would be used (cf. Visage, JBuilder, Visual Cafe). However, such tools can only really be used properly when the programmer has a true understanding of how the package supporting the tool actually works. Thus, for pedagogical reasons, user interface construction tools should not be used for these exercises.
Not only is the presented code poor, it is also the case that there are some problems with it. Ascertain what the problems are and make changes to the code to circumvent them.
Clearly, this question is not entirely straightforward, indeed it must be categorized as hard at this stage of your learning of Java. This is no reason not to attempt it, however. You may need to make extensive use of the tutorials on AWT and Swing as well as the manual pages. You will most likely put particular emphasis on the following classes: BorderLayout, FlowLayout, GridLayout, Container, ActionEvent, ActionListener, ButtonGroup, JButton, JDialog, JFrame, JLabel, JList, JMenu, JMenuBar, JMenuItem, JPanel, JRadioButton, JScrollPane, JTextField -- these are the user interface construction classes from Swing/AWT that I have made use of in my sample answer.
Russel Winder
Last updated: 2000-01-29