I've been having problems with my form program while trying to call data entered into a text field and displaying in a GUI after pressing a button. Here's my code.
import java.awt.*;
import java.awt.event.*;
public class ProjectForm {
public static void main(String[] args) {
Frame frm=new Frame("Personal Information Form");
frm.setSize(350,200);
frm.setVisible(true);
frm.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
Panel p = new Panel();
Panel p1 = new Panel();
Label jFirstName = new Label("First Name");
TextField lFirstName = new TextField(20);
Label jLastName =new Label("Last Name");
TextField lLastName=new TextField(20);
Label jYear = new Label("YYYY");
TextField lYear = new TextField(4);
Label jMonth = new Label("MM");
TextField lMonth = new TextField(2);
Label jDay = new Label("DD");
TextField lDay = new TextField(2);
p.setLayout(new GridLayout(12,0));
p.add(jFirstName);
p.add(lFirstName);
p.add(jLastName);
p.add(lLastName);
p1.add(jDay);
p1.add(lDay);
p1.add(jMonth);
p1.add(lMonth);
p1.add(jYear);
p1.add(lYear);
Button Submit=new Button("Submit");
p.add(Submit);
p1.add(p);
frm.add(p1,BorderLayout.NORTH);
String FName = lFirstName;
}
public void windowOpened(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
}