posted 7 years ago
Someone help me to complete this program. I want to store data in this form using serialization and deserialization.
public class College_Form extends JFrame implements ActionListener {
JTextField tf1, tf2, tf3, tf4;
JButton b1, b2, b3;
JLabel l1, l2, l3, l4, l5;
College_Form() {
l5 = new JLabel("NETAJI SUBHAS INSTITUTE OF TECHNOLOGY");
l5.setForeground(Color.red);
l5.setFont(new Font("Arial", Font.BOLD, 25));
l5.setAlignmentX(TOP_ALIGNMENT);
l1 = new JLabel("Name:");
l2 = new JLabel("Department:");
l3 = new JLabel("Dues:");
l4 = new JLabel("Roll:");
tf1 = new JTextField(20);
tf2 = new JTextField(20);
tf3 = new JTextField(10);
tf4 = new JTextField(10);
b1 = new JButton("Save");
b2 = new JButton("Clear");
b3 = new JButton("Cancel");
add(l5);
add(l1);
add(tf1);
add(l2);
add(tf2);
add(l3);
add(tf3);
add(l4);
add(tf4);
add(b1);
add(b2);
add(b3);
setLayout(null);
l5.setBounds(100, 10, 700, 100);
l1.setBounds(250,140,100,50);
l2.setBounds(250,190,100,50);
l3.setBounds(250,250,100,50);
l4.setBounds(250,300,100,50);
tf1.setBounds(350, 150, 300, 20);
tf2.setBounds(350, 200, 200, 20);
tf3.setBounds(350, 260, 100, 20);
tf4.setBounds(350, 310, 100, 20);
b1.setBounds(200, 400, 100, 30);
b2.setBounds(350, 400, 100, 30);
b3.setBounds(500, 400, 100, 30);
setVisible(true);
setSize(800, 600);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
}