Java Reference
In-Depth Information
Unfortunately, the close button problem is too complicated for right now, so we will hold off until the next
chapter to explain and solve that problem.
1.
Display the Employee source code and define four new private String variables called
empStreet, empCity, empState, empZip.
Right-click anywhere in the content pane and from the shortcut menu, select Source , then
Generate Getters and Setters .
2.
3.
Click the Select All button (see Figure 3-22 ) then the OK button.
Figure 3-22.
RAD generates all ten getter/setter methods after the last class variable definition. Now, you may not be
impressed because the generated code is very simple. However, the beauty and power of this feature is that it relieves
the programmer of tedious and error-prone coding. Also, notice how RAD knew that private class level variables are
eligible to be properties and only generated getters and setters for them.
 
Search WWH ::




Custom Search