I added a method to a class but it doesn't appear in the list of methods for that type in the Visual Composition Editor. Why not?

Scott Stanchfield

If your class already has an associated BeanInfo class, the BeanInfo class provides the sole determination of which methods define "features" in your bean.

If you create a method outside the BeanInfo editor, the BeanInfo has no idea that you intend that method to be a feature. If you use the Visual Composition Editor (VCE), the VCE asks the BeanInfo which methods are available and it doesn't list your method.

To add your method, open the class to the BeanInfo Editor (choose "Open to->BeanInfo" from the class' popup menu) and select "Add available features" from the "Features" menu. You can then select the method to add and the BeanInfo will "learn" about it.

If you add methods via the BeanInfo editor's "Create method feature" function, the BeanInfo automatically knows about them.


See also