Basic HTML version of Foils prepared May 19 99

Foil 39 Property Editors

From Javabeans Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Geoffrey Fox, Nancy McCracken, Wojtek Furmanski

HotSpots, bean example showing property editors
The Property Sheet box uses default java classes to read and write any property. You can provide your own methods by implementing the java.beans.PropertyEditor class.
To do this, you register your editor with the PropertyEditorManager.
You must also supply a BeanInfo class in which you override the getPropertyDescriptors method. In this method, you return the array of property descriptors as in the default, but in addition, you call setPropertyEditorClass for the property that you want to supply the editor.
A simple property editor supplies methods (for the beanbox to call to display and get properties): getValue, setValue, getAsText, setAsText, and getTags.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999