The property sheet for a bean provides a way to display and set initial property values for the bean. Changes made to values in the property sheet are applied immediately.
You can edit the properties for a single bean or select several beans and open a property sheet for them. When you change a property on the property sheet, the change affects all the selected beans.
Some of the tasks you can perform include:
To change the properties for a single bean, follow these steps:
To change the properties for multiple beans (multiple selection), follow these steps:
Once you open a property sheet, you can modify properties for most beans in the Visual Composition Editor. To open the properties on another bean select it in the Visual Composition Editor. To select if from within the property sheet:
Note: |
If a common property is not visible on the property sheet, select the Show expert features check box. To enable national language support for your composite, be sure to read Separating Strings for Translation. |
Some bean properties on the property sheet, such as border
and model, use interface editors. If the property has an interface
editor, a small button,
which indicates a secondary window, appears to the right when youselect the
value field for that property. When you select the
, the interface editor for that property appears.
The interface editor provides two options: Code String and Bean Implementing Interface. To enter your own code string for the property, select Code String and type your code in the entry field. To see a list of available interfaces, select Bean Implementing Interface. From the drop-down list, select the desired interface for that property and modify any values listed.
VisualAge enables you to set some bean properties using code strings. Curly braces, { }, in the value column of a bean property sheet indicate that you can type Java code directly into the property field.
For example, you can use code strings to dynamically instantiate a dialog window when the user selects a button.
This string directs VisualAge to create a new instance of MyDialog when the button is selected.
Visual beans have color properties for the foreground and background. To change a color property of a bean in its property sheet, do the following:
When you change bean colors, select colors that are available across various platforms.
For an example, open the background property in the property sheet for any of the com.ibm.ivj.examples shipped in the IBM Java Examples project.
Note: | If you are setting the background property of a Swing bean, be sure the opaque property of the bean is set to true. |
To change the font of a bean in its property sheet, do the following:
When you change bean fonts, select fonts that are available across various platforms.
For an example, open the font property in the property sheet for any com.ibm.ivj.examples.vc. class shipped in the IBM Java Examples project.
If a bean is embedded in a container that does not use a layout manager (null layout), you can change the x and y coordinates, the width, and the height using the bean property sheet. To modify the size and position features, do the following:
Note: | If you specify a non-null layout for the container, the bean position and sizing constraints are affected by that layout manager. |
When you open the bean property sheet using multiple selection, some size and position constraints may appear stippled rather than solid because the values for the field are not common to all the selected beans. Once you modify the constraint, however, all the selected beans have the same value and the constraint appears solid.
For an example of the different layout managers, see the COM.ibm.ivj.examples.vc.layoutmanagers.LayoutManagers class shipped in the IBM Java Examples project.
Some visual beans, such as JLabel and JButton, have icon properties. You can assign an icon to these beans through the property sheet.
To add an icon to a visual bean:
Some visual beans, such as buttons and menus, contain text strings. You can edit these labels through the property sheet.
To edit the text of a label:
Visual Composition Editor Overview
Property Sheets
Manipulating Beans Visually
Visual Composition Editor
Pop-Up Menus for the Visual Composition Editor