|
[Help | API Docs | Short Course| Magercises] If you've ever looked at the data model class for the JComboBox component of the JFC/Swing component set, you may have noticed that the data model is backed by a Vector. If, however, you don't need the synchronized access of a Vector (thus increasing performance) or you prefer the new Collections Framework, you can create your own implementation of the ComboBoxModel or MutableCom boBoxModel interface for storing the data in a List or more specifically in a ArrayList. This magercise has you create just such an implementation. If you aren't familiar with the Swing component set, don't worry. The Tester program includes all the necessary code to create the user interface. You are only responsible for finishing up the data model implementation. Skeleton CodeTasks
Where help exists, the task numbers above are linked to the step-by-step help page. Solution SourceDemonstrationWhen you run the Tester program, from the command line, with an argument list of Jim Joe Mary, you'll see the following screen after opening up the list of selections for the JComboBox:
Your output will differ if you provide different command line options (or your implementation is wrong). The Tester program automatically adds Tom, Dick, Harry, and Bill then deletes Tom and Bill. This tests your class. Next MagerciseMagercisesShort CourseCopyright © 1999 MageLang Institute. All Rights Reserved. | ||||
|
| ||||||||||||