Computer Science 122
Assignment 9
Due: April 25, 2002

For the last assignment, you are to add a new check to the list.  You will have to use TextFields to capture the data.  You may either put these in a panel on the frame for assignment 8 or create a new frame and have a button on the main frame that will ‘show’ it.  The command is just
     addFrame.show ();
There is a complete example of the latter on my website under Add Frame Example.  If you use two frames, you can have both on the screen at the same time.  Or you can ‘hide’ one while showing the other.  If you have just one frame, you should provide a second panel with TextFields for all the fields of the check.

Use getText () to get the strings in the TextFields.  Use
    checkNumber = Integer.parseInt (txtCheckNumber.getText ());
    amount = Double.parseDouble (txtAmount.getText ());
to change the strings in the TextFields into numbers.  This also requires a try-catch block.

If you have two frames, you should send the transaction list as a parameter to the second frame.  This is done with the constructor.  You should only access the file on disk when the user clicks either the read button or the save button.  Everything else should be done on the linked list in memory.  Access to memory is far faster than access to disk.

Extra Credit

For five points extra, you should give the user the option of adding either a check or a deposit.  Again this can be done either with a second frame or a panel on the one frame.  Use radio buttons (CheckBoxes) to indicate whether the addition will be a check or a deposit.

For another five points, add a search frame that will search for a check using the check number.   If the check is found, display it either in a TextArea or on a panel with TextFields.  If it is not found, display an error message saying that it is not in the list.