You are on page 1of 3

package bank;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

public class Registration extends JFrame implements ActionListener


{ JButton b,b1;
Registration()
{
setSize(500,500);
setLayout(null);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setTitle("Registration Form");

JLabel name=new JLabel("Name");


name.setBounds(50,50,80,30);
add(name);
JTextField name1=new JTextField();
name1.setBounds(140,50,80,30);
add(name1);

JLabel dob=new JLabel("DOB");


dob.setBounds(50,90,80,30);
add(dob);

JTextField dob1=new JTextField();


dob1.setBounds(140,90,80,30);
add(dob1);

ButtonGroup bg=new ButtonGroup();

JLabel gender=new JLabel("Gender");


gender.setBounds(50,130,80,30);
add(gender);

JRadioButton male=new JRadioButton("Male");


male.setBounds(140,130,80,30);
add(male);
bg.add(male);

JRadioButton female=new JRadioButton("Female");


female.setBounds(230,130,80,30);
add(female);
bg.add(female);
JLabel addr=new JLabel("Address");
addr.setBounds(50,170,80,30);
add(addr);
JTextField addr1=new JTextField();
addr1.setBounds(140,170,80,30);
add(addr1);

JLabel country=new JLabel("Country");


country.setBounds(50,210,80,30);
add(country);
String str[]={"India","pak"};
JComboBox cb=new JComboBox(str);
cb.setBounds(140,210,80,30);
add(cb);

JLabel lk=new JLabel("Language Known");


lk.setBounds(50,240,100,30);
add(lk);
JCheckBox m=new JCheckBox("Marathi");
m.setBounds(150,240,80,30);
add(m);
JCheckBox h=new JCheckBox("Hindi");
h.setBounds(240,240,80,30);
add(h);
JCheckBox e=new JCheckBox("English");
e.setBounds(330,240,80,30);
add(e);

b=new JButton("Submit");
b.setBounds(80,280,80,30);
add(b);
b.addActionListener(this);

b1=new JButton("Cancel");
b1.setBounds(170,280,80,30);
add(b1);
b1.addActionListener(this);

public static void main(String[] args) {


new Registration();
}

@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()==b)
{
new login();
//this.dispose();

}
else
if(e.getSource()==b1)
new Registration();
}

You might also like