I have a custom widget and I want to expose some of its properties using BeanInfo Class. I have written the BeanInfo Class, placed it in the same directory where my custom widget class is, packaged into jar and exported the jar to my test project.
The Designer does not expose my properties (does not seem to recognize my BeanInfo Class). Do I have set the Designer's Introspector's search path? If so, How should I do this??
Below is the code of my BeanInfo class.
public class ButtonBeanInfo extends SimpleBeanInfo {
PropertyDescriptor propDes[];
public PropertyDescriptor[] getPropertyDescriptor(){
//Class beanClass = new Button(null,-1).getClass();
try{
PropertyDescriptor text = new PropertyDescriptor("Text",
beanClass);
PropertyDescriptor image = new PropertyDescriptor("Image
", beanClass);
text.setBound(true);
image.setBound(true);
PropertyDescriptor propDes[] = {text,image};
}catch(IntrospectionException e){
}
return propDes;
}
public BeanDescriptor getBeanDescriptor(){
return new BeanDescriptor(beanClass);
}
private final static Class beanClass = Button.class;