I am trying to create a frame with 4 labels on it. When I run this class, it runs with no errors, but there is no frame that shows up? Any suggestions?
I should have a frame with 4 labels that read "test text" of 4 separate lines. Thanks for taking a look - Here is what I have:
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();
Label shipToLbl1 = new Label();
Label shipToLbl2 = new Label();
Label contactInfo = new Label();
custNameLbl.setBounds(62, 65, 176, 23);
shipToLbl1.setBounds(62, 120, 176, 23);
shipToLbl2.setBounds(62, 175, 176, 23);
contactInfo.setBounds(62, 230, 176, 23);
custNameLbl.setText("test text");
shipToLbl1.setText("test text");
shipToLbl2.setText("test text");
contactInfo.setText("test text");
this.add(custNameLbl);
this.add(shipToLbl1);
this.add(shipToLbl2);
this.add(contactInfo);
}
public static void main(String[] args) {
Customer cust = new Customer();
Customer CustFrame = cust;
}
}