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:
- Enter a Field Name, unique to the current class.
- 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:
- Click the Browse button.
- 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".
- Select the desired Type Name.
- 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.
- Click OK.
- If the field is an array, enable the Array check box. Specify the
number of Dimensions for the array.
- If applicable, specify an Initial Value for the field.
- 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.
- Click Finish.
- 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.
- Click Finish.
