In order to read an individual record, we shall define a method called readRecord that
reads in the surname, first name(s) and examination mark for an individual student.
Before looking at the code, it is probably useful to look ahead and see what the
intended output should look like. In order that the JFileChooser object may be
viewed as well, the screenshot in Fig. 4.5 shows the screen layout after one file has
been opened and then the ‘Open File’ button has been clicked on by the user.
Fig. 4.5 A JFileChooser object being used to select a file
The code for this application is shown below. If the reader wishes to create a
serial file for testing this program, this may be done very easily by using any text
editor to enter the required three fields for each of a series of students (each field
being followed by a carriage return).