Java Reference
In-Depth Information
private void
initialize() {
cSZLbl=
new
Label();
cSZLbl.setBounds(
new
Rectangle(64, 318, 270, 51));
cSZLbl.setBackground(Color.
yellow
);
cSZLbl.setForeground(Color.
blue
);
cSZLbl.setFont(
new
Font("Dialog", Font.
PLAIN
, 26));
cSZLbl.setText(emp.getEmpCity()+", " +
emp.getEmpState()+" " +
emp.getEmpZip());
streetLbl=
new
Label();
streetLbl.setBounds(
new
Rectangle(65, 259, 270, 51));
streetLbl.setBackground(Color.
yellow
);
streetLbl.setForeground(Color.
blue
);
streetLbl.setFont(
new
Font("Dialog", Font.
PLAIN
, 26));
streetLbl.setText(emp.getEmpStreet());
nameLbl=
new
Label();
nameLbl.setText(emp.getEmpName());
nameLbl.setLocation(
new
Point(64, 200));
nameLbl.setBackground(Color.
yellow
);
nameLbl.setForeground(Color.
blue
);
nameLbl.setFont(
new
Font("Dialog", Font.
PLAIN
, 26));
nameLbl.setSize(
new
Dimension(270, 51));
this
.setSize(
new
Dimension(400, 450));
this
.setTitle("Employee Information");
this
.setBackground(Color.
lightGray
);
this
.setVisible(
true
);
this
.add(nameLbl,
null
);
this
.add(streetLbl,
null
);
this
.add(cSZLbl,
null
);
this
.setExitButtonLocation();
}
}
Results of the Tutorial
Here is what we have as a result of the tutorial:
•
A new package called c4, with six java files.
•
EmployeeApp changed as specified in the Tutorial.
•
UsefulFrame, ExitButton, and EmployeeFrame defined as specified in Tutorial.
To verify that the tutorial was done correctly:
1.
Run EmployeeApp and verify the EmployeeFrame is displayed as in Figure
4-20
.