Java Reference
In-Depth Information
A search is a generic term for the process a computer performs to ascertain
the presence of a specific piece of data in a list or storage location. The data
entered by the user is called the search argument. A user enters a search argu-
ment, and the computer looks it up. For example, a user of the Classics on DVD
program may know the title of a movie but not know if the movie is located in
the collection. In another example, users may need to find more information
about the movie, such as the studio or year it was released. In a search, the user
enters the title of the movie, and the application program compares the title with
the titles in the program's list and then displays the results.
A sort is a generic term that refers to the ways to organize data alphanumer-
ically based on specific criteria. Typically, users request a sort based on a certain
field of data, such as sort by title, sort by studio, or sort by year. Once the sort
field is determined, the application program reorders or alphabetizes all accom-
panying data based on that specific field.
DESIGN THE SOLUTION Once you have analyzed the problem, the next step
is to design the user interface. The requirements document for the Classics on
DVD program requests a Swing interface with a scrollable text area to display a
formatted, detailed listing of the movies (Figure 7-3a). A drop-down list compo-
nent is required to choose how to sort. Because the request is specific about
desired menu options, a menu storyboard (Figure 7-3b on the next page) is a
good way to verify with the customer that the menu titles and shortcut keys sat-
isfy their needs. A shortcut key , or access key , is a special key combination used
to invoke commands on a menu. A shortcut key usually is an alternative to using
the mouse. For example, when you use CTRL + C to copy selected text, you are
using a shortcut key. In Figure 7-3b, the underlined letters in the menu system
are shortcut keys.
FIGURE 7-3a
 
Search WWH ::




Custom Search