Home

 

Creating Java attributes (fields) and getter and setter methods

After we have the needed Java classes and interfaces, we add Java attributes (fields) to them using the Create Java Field wizard or writing directly the field declaration into the interface or class body in the Java editor. The Create Java Field wizard gets only called through the Visualizer Class Diagram editor, by choosing one of the following options:

Move the mouse pointer anywhere over the interface or class in the diagram editor, and click Add Java Field in the pop-up action box that appears.

Alternatively, right-click the interface or class in the diagram editor and select Add Java Æ Field. The Create Java Field wizard opens.
ibm.com/redbooks