MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / GUI

Class GUI

Programs/Swing_Simple_Registration_Form.java:8–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import java.awt.*;
7import java.awt.event.*;
8public class GUI extends JFrame implements ActionListener{
9 JFrame jf;
10 JLabel jl1,jl2,jl3,jl4,jl5,jl6,jl7;
11 JTextField jtf1,jtf2,jtf3,jtf4;
12 JPasswordField jpf1,jpf2;
13 JButton jb1,jb2;
14 JComboBox jcb;
15 Container c;
16 GUI(){
17 jf=new JFrame("Registration Form");
18 c=jf.getContentPane();
19 jf.setLocation(100,100);
20 jf.setSize(350,350);
21 c.setBackground(Color.PINK);
22 jf.setLayout(null);
23 jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
24 jl1=new JLabel("NAME");
25 jl2=new JLabel("GENDER");
26 jl3=new JLabel("FATHER NAME");
27 jl4=new JLabel("PASSWORD");
28 jl5=new JLabel("CONFIRM PASSWORD");
29 jl6=new JLabel("CITY");
30 jl7=new JLabel("EMAIL");
31 jl1.setBounds(10,50,200,20);
32 jl2.setBounds(10,70,200,20);
33 jl3.setBounds(10,90,200,20);
34 jl4.setBounds(10,110,200,20);
35 jl5.setBounds(10,130,200,20);
36 jl6.setBounds(10,150,200,20);
37 jl7.setBounds(10,170,200,20);
38 c.add(jl1);
39 c.add(jl2);
40 c.add(jl3);
41 c.add(jl4);
42 c.add(jl5);
43 c.add(jl6);
44 c.add(jl7);
45 jtf1=new JTextField();
46 jtf1.setBounds(150,50,150,20);
47 c.add(jtf1);
48 String[] str={"SELECT","Male","Female","Other"};
49 jcb=new JComboBox(str);
50 jcb.setBounds(150,70,150,20);
51 c.add(jcb);
52 jtf2=new JTextField();
53 jtf2.setBounds(150,90,150,20);
54 c.add(jtf2);
55 jpf1=new JPasswordField();
56 jpf1.setBounds(150,110,150,20);
57 c.add(jpf1);
58 jpf2=new JPasswordField();
59 jpf2.setBounds(150,130,150,20);
60 c.add(jpf2);
61 jtf3=new JTextField();
62 jtf3.setBounds(150,150,150,20);
63 c.add(jtf3);
64 jtf4=new JTextField();
65 jtf4.setBounds(150,170,150,20);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected