Keeping beans and BeanInfo classes in the same package
A Java bean and its associated BeanInfo class are in the same package, then the introspector will be able to find the BeanInfo class.
This is the simplest but also least likely scenario because coupling the run-time and design time classes in the same package makes for more work at deployment time to separate them.
For example, a project called MyProject contains a package called myclasses that contains the classes MyJavaBean and MyJavaBeanBeanInfo. Whenever the bean myclasses.MyJavaBean is used, either for development of a class within MyProject or for development of a class in another project that includes MyProject in its Java build path, the introspector will locate its BeanInfo class myclasses.MyJavaBeanBeanInfo.
To keep BeanInfo classes in the same package as your visual classes:
- In the Java perspective, create your BeanInfo classes.
- Save the BeanInfo classes in the same project and same package as your beans that use the BeanInfo classes.
The visual editor will locate and introspect the BeanInfo classes during design time to determine the properties of the Java bean.
Parent topic
Specifying the location of BeanInfo classes
Related concepts
BeanInfo classes and introspection
Related tasks
Keeping beans and BeanInfo classes in different packages in the same project
Keeping beans and BeanInfo classes in different projects
Keeping BeanInfo classes in a JAR file
Explicitly defining the location of BeanInfo classes