|
Help API Docs About This Short Course Short Course Exercises With this exercise, you will complete a phonebook look-up applet. The skeleton code creates a GUI that consists of a pull-down list of names, a text field for entry of a phone number to look up, and a command button to activate the look-up operation. It is your job to add the event handling to the applet. There are three different events that must be handled. When the user changes the name in the pull-down list, the applet should look up the appropriate telephone number in the phonebook. When the user enters a phone number in the text field and presses return or selects the button, the applet should look up the number in the reverse phonebook and change the name in the pull-down list. Finally, the applet should restrict input in the text field to digits and the '-' character. If a look-up operation fails, the applet should simply beep. The actual telephone book appears below:
PrerequisitesSkeleton CodeTasks
Where help exists, the task numbers above are linked to the step-by-step help page. Solution SourceDemonstrationThis exercise only runs within browsers that support the Java Runtime Environment 1.1 and appletviewer. If you are using an appropriate browser, try this exercise. The output should look similar to the following:
Next ExerciseExercisesShort CourseCopyright 1996-2000 jGuru.com. All Rights Reserved. | ||||||||||||||||||||||||||||||||||
|
| ||||||||||||