Creating a Bean Property

  1. In the Explorer window, find the class for your bean, expand its node, and right-click Bean Patterns.

  2. In the contextual menu, choose New Property or New The New Property Pattern dialog box appears, enabling you to customize the code to be generated for the property.

  3. Type in a name for the property. The name must be a valid Java identifier. When the property is generated, get is prepended to this name for the getter method and set is prepended for the setter method.

  4. In the Type combo box, select the type of property from the list, or type in a class identifier.

  5. In the Mode combo box, choose whether to generate the getter method (Read Only), the setter method (Write Only), or both (Read/Write).

  6. Select   or both options if applicable. The usefulness of selecting these options is enhanced if you also select the Generate Property Change Support option as described in Step 7.

  7. Select any combination of these options in the New Property Pattern dialog box:

    If you are creating an indexed property, the getter and setter methods generated with the options above include a parameter for the index of the element to be read or written. In addition, you can select Non-Index Options to generate getter and setter methods that apply to all elements of the array.

  8. Click OK to generate the component property methods for the selected class.
See also
Creating a Bean

Creating a Bean Event Set

Deleting a Property or Event Set

Generating BeanInfo

Legal Notices