D. Before we can call our Web service, make sure that our ArrayList object al is empty by executing the clear() method.
E. The queryFaculty() method defined in our Web service is called to perform this fac-ulty data query. Two points to be noted are: 1) the argument of this method is a selected faculty name obtained from the getSelectedItem() method from the Faculty Name combo box ComboName. Since this method returns an object, a toString() method must be attached to convert it to a string. 2) An ArrayList cast must be used to make sure that the returned query result is an ArrayList type since an ArrayList type is used
in our Web service project. The query result is assigned to our ArrayList instance, al.
F. A for() loop is used to pick up each column from the query result using the get() method. Two points to be noted are: 1) the argument of the get() method indicates the index of each column in the returned query result is a single row, and the data type of this method is an object. Therefore, a toString() method must be attached to convert it to a string. 2) To assign each column to each item in the f _ field array, the setText() method must be used.
G. The catch block is used to track and display any possible exception during the Web ser-vice calling process.
H. Another try-catch block is used to call a user-defined method, ShowFaculty(), that will be built later to call our Web method to query and display a selected faculty image.
I. The user-defined method ShowFaculty() is modified by removing its argument. The code for this method will be built later.
Now let’s build the code for our user-defined method ShowFaculty() to get and display a selected faculty image by calling another operation, QueryImage(), built in our Web Service.
In the opened FacultyFrame.java file, browse to the ShowFaculty() method and replace all original code with the code shown in Figure 9.35.

FIGURE 9.35 The modified code for the ShowFaculty() method.
Let’s have a closer look at the modified code to see how it works.