import java.awt.Frame;
import java.awt.Label;
public class CustFrame extends Frame {
public CustFrame(Customer cust) {
this.setSize(300, 282);
this.setLayout(null);
this.setVisible(true);
Label custNameLbl = new Label();
this.setSize(300, 282);
this.setLayout(null);
custNameLbl.setBounds(62, 65, 176, 23);
custNameLbl.setText("test text");
this.add(custNameLbl);
this.setVisible(true);
Label shipToLbl1 = new Label();
this.setSize(300, 282);
this.setLayout(null);
shipToLbl1.setBounds(62, 120, 176, 23);
shipToLbl1.setText("test text");
this.add(shipToLbl1);
this.setVisible(true);
Label shipToLbl2 = new Label();
this.setSize(300, 282);
this.setLayout(null);
shipToLbl2.setBounds(62, 175, 176, 23);
shipToLbl2.setText("test text");
this.add(shipToLbl2);
this.setVisible(true);
Label contactInfo = new Label();
this.setSize(300, 282);
this.setLayout(null);
contactInfo.setBounds(62, 230, 176, 23);
contactInfo.setText("test text");
this.add(contactInfo);
this.setVisible(true);
custNameLbl.setText(cust.getCustName());
shipToLbl1.setText(cust.getShipToStreet());
shipToLbl2.setText(cust.getShipToCity());
contactInfo.setText(cust.getContactPerson());
}
public static void main(String[] args) {
Customer cust = new Customer();
CustFrame Customer = new CustFrame(cust);
}
}
public class Customer {
private String custName;
private String contactPerson;
private String contactPhone;
private String shipToStreet;
private String shipToCity;
private String shipToState;
private String shipToZip;
}
public String getCustName() {
return custName;
}
public void setCustName(String custName) {
this.custName = custName;
}
public String getContactPerson() {
return contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getShipToStreet() {
return shipToStreet;
}
public void setShipToStreet(String shipToStreet) {
this.shipToStreet = shipToStreet;
}
public String getShipToCity() {
return shipToCity;
}
public void setShipToCity(String shipToCity) {
this.shipToCity = shipToCity;
}
public String getShipToState() {
return shipToState;
}
public void setShipToState(String shipToState) {
this.shipToState = shipToState;
}
public String getShipToZip() {
return shipToZip;
}
public void setShipToZip(String shipToZip) {
this.shipToZip = shipToZip;
}
public Customer(String name, String person, String phone, String street, String city, String state, String zip){
this.setCustName(name);
this.setContactPerson(person);
this.setContactPhone(phone);
this.setShipToStreet(street);
this.setShipToCity(city);
this.setShipToState(state);
this.setShipToZip(zip);
}
}
public class CustApp {
/**
* @param args
*/
public static void main(String[] args) {
Customer c = new Customer();
c.setCustName("Kindness Foods");
c.setShipToStreet("1 Miko St");
c.setShipToCity("Human");
c.setShipToState("ME");
c.setShipToZip("03234");
c.setContactPerson("Joe Samaritan");
c.setContactPhone("555-3333");
CustFrame cf = new CustFrame(c);