Java Reference
In-Depth Information
The EmployeeFrame executable source code should look like the following:
package
c4;
import
java.awt.Dimension;
import
java.awt.Color;
import
java.awt.Label;
import
java.awt.Rectangle;
import
java.awt.Point;
public class
EmployeeFrame
extends
UsefulFrame {
private
Label nameLbl=
null
;
private
Label streetLbl=
null
;
private
Label cSZLbl=
null
;
private
Employee emp;
public
EmployeeFrame(Employee employee) {
super
();
this.emp=employee;
initialize();
}
private void
initialize() {
cSZLbl=
new
Label();
cSZLbl.setBounds(
new
Rectangle(80, 318, 150, 20));
cSZLbl.setText( emp.getEmpCity()+", " +
emp.getEmpState()+" " +
emp.getEmpZip());
streetLbl=
new
Label();
streetLbl.setBounds(
new
Rectangle(80, 263, 150, 20));
streetLbl.setText(emp.getEmpStreet());
nameLbl=
new
Label();
nameLbl.setText(emp.getEmpName());
nameLbl.setLocation(
new
Point(80, 200));
nameLbl.setSize(
new
Dimension(150, 20));
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();
}
}