![]()
(chat, newsreader, calendar)
|
![]() |
|
|
|
Course Notes Table of Contents Exercises | Online Training Index
|
|
Help: Inspecting Beans with BeanInfo and Juan Valdez
MageLang Institute
|
|
Help is available for each task, or you can go straight to
the solution source code.
Use the Object.getClass method. Task 2Now that you have a Class, use the Introspector to get at its BeanInfo.Use the Introspector.getBeanInfo method and remember to catch the IntrospectionException exception. Task 3From the BeanInfo, get the list of properties for the Bean. You will end up with an array of PropertyDescriptors.Use the BeanInfo.getPropertyDescriptors method. Task 4For each element of the PropertyDescriptor array, display the name, datatype, and current value.
Task 5From the BeanInfo, get the list of event sets for the Bean. You will end up with an array of EventSetDescriptors.Use the BeanInfo.getEventSetDescriptors method. Task 6For each element of the EventSetDescriptor array, display the name and listener type.
Task 7Use the Burro frame provided in Burro.java to test out the inspect method of Valdez. Burro creates a Frame with a bunch of AWT Beans on it. When you double-click on a List element, select a Checkbox, or press return in the TextField, Juan goes to work and inspects the Bean selected. The results of the inspection are shown in the TextArea in the middle.Compile and run: javac Burro.java java Burro
|
|
Copyright © 1997 MageLang Institute. All Rights Reserved May-97 Copyright © 1996, 1997 Sun Microsystems Inc. All Rights Reserved |