A basic bean question
Hi:
I am not very sure what is meant by "properties of a bean". In setProperty action..when you are setting the properties of a bean..what exactly are you setting?
Are properties just methods in the bean? and when you are setting properties, are you matching the parameters of all methods in that bean with the corresponding variables?
Thanks in Advance
[385 byte] By [
lj75] at [2007-9-26 5:12:17]

Properties are named attributes of a bean. For example, color. When you set a property, you set an internal state of the bean. A property may be stored in an instance variable, the name of which need not match anything.
Here is an example:
public class GraphBean {
protected Color grcl;
public void setGraphColor(Color cl){
grcl = cl;
}
public Color getGraphColor(){
return grcl;
}
}
The name of a property is deduced from the getter/setter method names. The substring that comes after "set" and/or "get" in the setter/getter method name is the property name. In the above example, the property name is graphColor.
However, if you provide a BeanInfo class, you need not follow the method naming conventions. You can specify any setter and getter methods for a given property.
If you don't like to follow the naming conventions, create a BeanInfo class and provide the property descriptors. See the JavaBeans spec or a book for more details.