6.3.9.5 Display a Student Picture for the Selected Student
As we did for the FacultyFrame Form class, we can display a student picture as a part of the student information in the Canvas component. The code is identical to that in our user-defined method, ShowFaculty(), in Section 6.3.7.6.2; refer to that section to get more detailed information about this piece of code. Figure 6.53 shows the detailed code for this method. Only one modification is made for this method, which is to change fimgName to simgName, as shown in the highlighted code in lines B, C and F in Figure 6.53.

FIGURE 6.53 The code for the ShowStudent() method.

FIGURE 6.54 The code for the Back button Click event handler.

FIGURE 6.55 A running sample of the StudentFrame Form window.
The final coding process is to build the code for the Back button event handler. The function of this event handler is to close the current StudentFrame Form window and direct control back to the SelectFrame Form window to enable users to select a desired item to perform another data query action.
Open that event handler and enter the code shown in Figure 6.54 into it. Due to the simplicity of this piece of code, no explanation is given for it.
At this point, we have finished the code development for the StudentFrame Form class. Now let’s build and run our project. Click on the Clean and Build Main Project button from the toolbar to build the project. Then click on the Run Project button (green arrow button) on the tool bar to run the project.
Complete the login process by entering jhenry and test into the Username and Password box, respectively, and select the Student Information item from the Selection combo box to open the StudentFrame Form, as shown in Figure 6.55.
Select a desired student from the Student Name combo box, and then click on the Select but-ton to try to retrieve all pieces of information related to the selected student. A sample run result is shown in Figure 6.55.
Click on the Back button to return to the SelectionFrame Form to allow users to perform other queries from other Forms, or click on the Exit button to terminate the project.
A complete project, OracleSelectStudent, can be found in the folder Class DB Projects\ Chapter 6 that is located in the Students folder at the CRC Press ftp site (see Figure 1.2 in Chapter 1).