Java Reference
In-Depth Information
You may be wondering why we originally defined the superclass as Frame and then changed it to UsefulFrame.
As mentioned earlier, VE has coding standards. If a class does not follow these standards, VE does not “play well” with
that class. For example, UsefulFrame was not created as a Visual class therefore, it does not follow the VE standards
(i.e., it doesn't have an initialize method, a long variable called serialVersionUID, etc.) Because of this, if we define a
new class as a subclass of UsefulFrame, VE cannot display the class in the Design pane. This means you cannot drag
and drop components, use the Properties view, etc. and will only be able to modify the class by changing the source.
3.
In the Design pane, click on the frame to activate the Properties view.
4.
In the Properties view, define the frame size as 400 by 400 and place it 100 pixels from the
top and left of the screen.
5.
Set the frame's visible property to true and layout to null.
6.
In the main method, add the following to create an EnterEmpInfo object:
EnterEmpInfo eei = new EnterEmpInfo();
7.
Create five labels called empNumLbl, empNameLbl, empStreetLbl, empCSZLbl,
empPRLbl with the following text:
Employee Number
Name
Street Address
City, State, and Zip
Hourly Pay Rate
8.
Create five text fields called empNumTF, empNameTF, empStreetTF, empCSZTF, and
empPRTF.
9.
Size, position, and align the text fields and labels on the frame such that when the class is
run as a Java application, the frame appears as in Figure 5-6 .
 
Search WWH ::




Custom Search