-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.java
101 lines (77 loc) · 1.88 KB
/
Car.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.lang.*;
public class Car extends JFrame
{
JLabel lbl2;
JTextField txt1,txt2,txt3,txt4,txt5;
JButton save,clear,back;
Font f1,f2;
JComboBox cmb1;
ImageIcon img;
MyActionListener1 ml = new MyActionListener1(this);
Car()
{
super("Get car insurance");
setLayout(null);
setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
txt1=new JTextField();
txt2=new JTextField();
txt3=new JTextField();
txt4=new JTextField();
txt5=new JTextField();
img = new ImageIcon("Car.png");
lbl2 = new JLabel(img);
lbl2.setBounds(0,0,img.getIconWidth(), img.getIconHeight());
lbl2.setVisible(true);
save =new JButton(" SAVE ");
clear =new JButton(" CLEAR ");
back =new JButton("< CAR POLICY");
String[] choice = {"Select","Male", "Female", "Others", "Prefer to not Say"};
cmb1 = new JComboBox(choice);
f1 = new Font("Segoe UI Black",Font.BOLD,30);
f2 = new Font("Segoe UI Black",Font.BOLD,20);
back.setFont(f2);
save.setFont(f1);
clear.setFont(f1);
cmb1.setFont(f1);
txt1.setFont(f1);
txt2.setFont(f1);
txt3.setFont(f1);
txt4.setFont(f1);
txt5.setFont(f1);
add(txt1);
add(txt2);
add(txt3);
add(txt4);
add(txt5);
// add(cmb1);
add(save);
add(clear);
add(back);
add(lbl2);
txt1.setBounds(700,280,300,100);
cmb1.setBounds(700,410,300,100);
txt3.setBounds(700,540,300,100);
txt4.setBounds(700,670,300,100);
txt5.setBounds(700,800,300,100);
save.setBounds(1300,300,300,100);
clear.setBounds(1300,700,300,100);
back.setBounds(50,50,300,100);
save.addActionListener(ml);
back.addActionListener(ml);
clear.addActionListener(ml);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}
public static void main(String args[])
{
}
}