Skip to content

Commit aff47ba

Browse files
committed
Add vidyaa18
1 parent 0954032 commit aff47ba

File tree

1 file changed

+325
-0
lines changed

1 file changed

+325
-0
lines changed

petshop/petshop.java.java

+325
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,325 @@
1+
import java.awt.EventQueue;
2+
import java.awt.event.*;
3+
import java.awt.*;
4+
import java.awt.Font;
5+
import java.awt.event.ActionListener;
6+
import java.awt.event.ActionEvent;
7+
import javax.swing.JLabel;
8+
import javax.swing.JTextField;
9+
import javax.swing.*;
10+
import javax.swing.JFrame;
11+
import javax.swing.ImageIcon;
12+
13+
14+
15+
public class eps {
16+
17+
private JFrame frame;
18+
private JLabel z1;
19+
private JLabel y1;
20+
private JLabel y2;
21+
private JLabel y3;
22+
private JLabel y4;
23+
private JLabel x1;
24+
private JLabel x2;
25+
private JLabel l1;
26+
private JLabel l2;
27+
private JLabel l3;
28+
private JLabel l4;
29+
private JLabel l5;
30+
private JLabel l6;
31+
private JLabel l7;
32+
private JLabel l8;
33+
private JLabel a1;
34+
private JLabel a2;
35+
private JLabel a3;
36+
private JLabel a4;
37+
private JLabel a5;
38+
private JLabel a6;
39+
private JLabel a7;
40+
private JLabel a8;
41+
private JLabel a9;
42+
private JLabel a0;
43+
public static void main(String[] args) {
44+
EventQueue.invokeLater(new Runnable() {
45+
public void run() {
46+
try {
47+
eps window = new eps();
48+
window.frame.setVisible(true);
49+
} catch (Exception e) {
50+
e.printStackTrace();
51+
}
52+
}
53+
});
54+
}
55+
56+
public eps() {
57+
initialize();
58+
}
59+
60+
private void initialize() {
61+
frame = new JFrame();
62+
frame.setBounds(50, 50, 50, 50);
63+
64+
JFrame f = new JFrame("Pet Store");
65+
JButton b1 = new JButton("Login");
66+
JButton b2 = new JButton("Register a pet");
67+
JButton b3 = new JButton("Rescued pets");
68+
JButton b4 = new JButton("Missing pets");
69+
z1=new JLabel(" NO.15 PET SHOP ");
70+
71+
z1.setBounds(250,100,200,50);
72+
b1.setBounds(200,200,200,50);
73+
b2.setBounds(200,300,200,50);
74+
b3.setBounds(200,400,200,50);
75+
b4.setBounds(200,500,200,50);
76+
77+
f.add(z1);
78+
f.add(b1);
79+
f.add(b2);
80+
f.add(b3);
81+
f.add(b4);
82+
83+
84+
f.setLayout(null);
85+
f.setVisible(true);
86+
f.setSize(800,800);
87+
b1.addActionListener(new ActionListener()
88+
{
89+
public void actionPerformed(ActionEvent e) {
90+
JFrame f2 = new JFrame("LOGIN DETAILS");
91+
f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
92+
JButton but1 = new JButton("Exit");
93+
JButton but2 = new JButton("Login");
94+
JTextField t1=new JTextField();
95+
JTextField t2=new JTextField();
96+
97+
x1=new JLabel("NAME : ");
98+
x2=new JLabel("PASSWORD : ");
99+
100+
x1.setBounds(50,100,200,50);
101+
t1.setBounds(300,100,200,50);
102+
x2.setBounds(50,200,200,50);
103+
t2.setBounds(300,200,200,50);
104+
105+
but2.setBounds(50,500,200,45);
106+
but1.setBounds(300,500,200,45);
107+
108+
f2.add(but1);
109+
f2.add(but2);
110+
111+
f2.add(x1);
112+
f2.add(x2);
113+
114+
f2.add(t1);
115+
f2.add(t2);
116+
117+
f2.setLayout(null);
118+
f2.setVisible(true);
119+
f2.setSize(800,800);
120+
}
121+
});
122+
b2.addActionListener(new ActionListener()
123+
{
124+
public void actionPerformed(ActionEvent e) {
125+
JFrame f3 = new JFrame("Registration");
126+
JButton button1 = new JButton("DOG");
127+
JButton button2 = new JButton("CAT");
128+
129+
button1.setBounds(200,200,200,50);
130+
button2.setBounds(200,300,200,50);
131+
132+
f3.add(button1);
133+
f3.add(button2);
134+
135+
f3.setLayout(null);
136+
f3.setVisible(true);
137+
f3.setSize(800,800);
138+
button1.addActionListener(new ActionListener()
139+
{
140+
public void actionPerformed(ActionEvent e) {
141+
JFrame g1 = new JFrame("Dog Registration");
142+
JButton buts1 = new JButton("Exit");
143+
JButton buts2 = new JButton("Submit");
144+
JTextField t1=new JTextField();
145+
JTextField t2=new JTextField();
146+
JTextField t3=new JTextField();
147+
JTextField t4=new JTextField();
148+
JTextField t5=new JTextField();
149+
JTextField t6=new JTextField();
150+
151+
l1=new JLabel("DOG NAME : ");
152+
l2=new JLabel(" AGE : ");
153+
l3=new JLabel("BREED : ");
154+
l4=new JLabel(" SEX : ");
155+
y1=new JLabel("OWNER'S NAME : ");
156+
y2=new JLabel("OWNER'S LOCALITY : ");
157+
158+
l1.setBounds(50,100,200,50);
159+
t1.setBounds(300,100,200,50);
160+
l2.setBounds(50,200,200,50);
161+
t2.setBounds(300,200,200,50);
162+
l3.setBounds(50,300,200,50);
163+
t3.setBounds(300,300,200,50);
164+
l4.setBounds(50,400,200,50);
165+
t4.setBounds(300,400,200,50);
166+
y1.setBounds(50,500,200,50);
167+
t5.setBounds(300,500,200,50);
168+
y2.setBounds(50,600,200,50);
169+
t6.setBounds(300,600,200,50);
170+
171+
172+
buts2.setBounds(50,700,200,45);
173+
buts1.setBounds(300,700,200,45);
174+
175+
g1.add(buts1);
176+
g1.add(buts2);
177+
g1.add(l1);
178+
g1.add(l2);
179+
g1.add(l3);
180+
g1.add(l4);
181+
g1.add(y1);
182+
g1.add(y2);
183+
184+
g1.add(t1);
185+
g1.add(t2);
186+
g1.add(t3);
187+
g1.add(t4);
188+
g1.add(t5);
189+
g1.add(t6);
190+
191+
g1.setLayout(null);
192+
g1.setVisible(true);
193+
g1.setSize(1200,1200);
194+
195+
buts2.addActionListener(new ActionListener()
196+
{
197+
public void actionPerformed(ActionEvent e) {
198+
JOptionPane.showMessageDialog(frame.getComponent(0), "Sussesfully Submitted");
199+
}
200+
});
201+
}
202+
});
203+
button2.addActionListener(new ActionListener()
204+
{
205+
public void actionPerformed(ActionEvent e) {
206+
JFrame g2 = new JFrame("Cat Registration");
207+
JButton butts1 = new JButton("Exit");
208+
JButton butts2 = new JButton("Submit");
209+
JTextField t1=new JTextField();
210+
JTextField t2=new JTextField();
211+
JTextField t3=new JTextField();
212+
JTextField t4=new JTextField();
213+
JTextField t5=new JTextField();
214+
JTextField t6=new JTextField();
215+
216+
217+
l1=new JLabel("CAT NAME : ");
218+
l2=new JLabel(" AGE : ");
219+
l3=new JLabel("COLOUR : ");
220+
l4=new JLabel(" SEX : ");
221+
y3=new JLabel("OWNER'S NAME : ");
222+
y4=new JLabel("OWNER'S LOCALITY : ");
223+
224+
l1.setBounds(50,100,200,50);
225+
t1.setBounds(300,100,200,50);
226+
l2.setBounds(50,200,200,50);
227+
t2.setBounds(300,200,200,50);
228+
l3.setBounds(50,300,200,50);
229+
t3.setBounds(300,300,200,50);
230+
l4.setBounds(50,400,200,50);
231+
t4.setBounds(300,400,200,50);
232+
y3.setBounds(50,500,200,50);
233+
t5.setBounds(300,500,200,50);
234+
y4.setBounds(50,600,200,50);
235+
t6.setBounds(300,600,200,50);
236+
237+
238+
butts2.setBounds(50,700,200,45);
239+
butts1.setBounds(300,700,200,45);
240+
241+
g2.add(butts1);
242+
g2.add(butts2);
243+
g2.add(l1);
244+
g2.add(l2);
245+
g2.add(l3);
246+
g2.add(l4);
247+
g2.add(y3);
248+
g2.add(y4);
249+
250+
g2.add(t1);
251+
g2.add(t2);
252+
g2.add(t3);
253+
g2.add(t4);
254+
g2.add(t5);
255+
g2.add(t6);
256+
257+
258+
g2.setLayout(null);
259+
g2.setVisible(true);
260+
g2.setSize(1200,1200);
261+
262+
butts2.addActionListener(new ActionListener()
263+
{
264+
public void actionPerformed(ActionEvent e) {
265+
JOptionPane.showMessageDialog(frame.getComponent(0), "Sussesfully Submitted");
266+
}
267+
});
268+
}
269+
});
270+
}
271+
});
272+
b3.addActionListener(new ActionListener()
273+
{
274+
public void actionPerformed(ActionEvent e) {
275+
JFrame f4 = new JFrame("RESCUED PETS");
276+
ImageIcon ii = new ImageIcon("C:/java/jimmy2.gif");
277+
ImageIcon ij = new ImageIcon("C:/java/ramu2.gif");
278+
a1=new JLabel("RESCUED PETS DETAILS :");
279+
a2=new JLabel(" (1) Jimmy(cat) is one of the pets rescued by our NGOs.It is 22 months old and black in colour.");
280+
a3=new JLabel(ii);
281+
a4=new JLabel(" (2) Ramu(dog) is one of the pets rescued by our NGOs.It is 38 months old.It belongs to German Shepherd breed.It is a highly inteligent dog.");
282+
a5=new JLabel(ij);
283+
a1.setBounds(50,30,200,50);
284+
a2.setBounds(50,60,800,50);
285+
a3.setBounds(50,80,350,300);
286+
a4.setBounds(50,360,900,50);
287+
a5.setBounds(50,390,500,400);
288+
f4.add(a1);
289+
f4.add(a2);
290+
f4.add(a3);
291+
f4.add(a4);
292+
f4.add(a5);
293+
f4.setLayout(null);
294+
f4.setVisible(true);
295+
f4.setSize(1200,1200);
296+
}
297+
});
298+
b4.addActionListener(new ActionListener()
299+
{
300+
public void actionPerformed(ActionEvent e) {
301+
JFrame f5 = new JFrame("Missing pets");
302+
ImageIcon ik = new ImageIcon("C:/java/peter2.gif");
303+
ImageIcon il = new ImageIcon("C:/java/Roni2.gif");
304+
a6=new JLabel("MISSING PETS DETAILS :");
305+
a7=new JLabel(" (1) Peter(dog) is missing since last month.It belongs to Golden Retriever breed.The image of missing dog is shown below.If found please contact pet owner , 9413299638.");
306+
a8=new JLabel(ik);
307+
a9=new JLabel(" (2) Roni(cat) is missing since last week.It is orange in colour.The image of missing cat is shown below.If found please contact pet owner , 9413299638.");
308+
a0=new JLabel(il);
309+
a6.setBounds(50,30,200,50);
310+
a7.setBounds(50,60,960,50);
311+
a8.setBounds(50,80,350,300);
312+
a9.setBounds(50,360,950,50);
313+
a0.setBounds(50,390,450,250);
314+
f5.add(a6);
315+
f5.add(a7);
316+
f5.add(a8);
317+
f5.add(a9);
318+
f5.add(a0);
319+
f5.setLayout(null);
320+
f5.setVisible(true);
321+
f5.setSize(1200,1200);
322+
}
323+
});
324+
}
325+
}

0 commit comments

Comments
 (0)