Search VisualAge for Java Information Go to Information Home Page Go to VisualAge for Java WWW Site

Create Field

The Add Field SmartGuide lets you create a new field for the class selected when you started the SmartGuide.  To create a new field:

  1. Enter a Field Name, unique to the current class.
  2. Provide a type for the field, by typing in a type name, selecting one from the drop-down list, which contains primative types and types within the current package, or by selecting one from a list of types in the workspace.  To select a type:
    1. Click the Browse button.
    2. In the Types dialog box, enter a search Pattern based on the unqualified type name.  For example, if you want the type sun.awt.image.Image, type "Im".
    3. Select the desired Type Name.
    4. Select the desired Package Name.  For example, if you selected the type name, Image, there may be two packages that have a type called Image, java.awt and sun.awt.image.
    5. Click OK.
  3. If the field is an array, enable the Array check box.  Specify the number of Dimensions for the array.
  4. If applicable, specify an Initial Value for the field.
  5. If you are adding the field to a class, then select an Access Modifier and any Other Modifiers that apply (final, static, transient, or volatile).  These options are unavailable for fields in interfaces.
  6. Click Finish.
  7. If you want the SmartGuide to generate default getter and setter methods (methods that retrieve or set values for the field), enable the Create a getter method and Create a setter method check boxes.
  8. Click Finish.