Tuesday, 28 April 2009

BeanInfo class - to control behaviour of new components/beans in Visual Editor

Implement java.bean.BeanInfo class to provide information about your bean. SimpleBeanInfo is a support class to make it easy to make BeanInfo classes. It has a method getBeanDescriptor which by default returns null. A BeanDescriptor provides global information about a bean. This is needed by builder tools.

Other critical things to know about JavaBeans:
1. Beans use events to communicate with other beans. Beans wanting to receive events (listener beans) register interest with source beans (which fire events).
2. Persistence enable JavaBeans to save their state so they can be restored later.

JavaBean configuration may be defined in a java.util.ResourceBundle object (which contains locale-specific objects). When a JavaBean needs a local-specific resource it can load it from a ResourceBundle for the specific locale. This has been around since JDK 1.1 and is consequently a very basic building block of Java.

No comments: