-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchForm.java
More file actions
153 lines (128 loc) · 4.26 KB
/
SearchForm.java
File metadata and controls
153 lines (128 loc) · 4.26 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
@SuppressWarnings("all")
public class SearchForm extends JFrame implements ActionListener
{
private JButton cmd_SearchBday,cmd_SearchPno,cmd_SearchEmail,cmd_SearchAdd,cmd_SearchAnn,cmd_SearchRem,cmd_Back;
public SearchForm(String fname)
{
super(fname);
cmd_SearchBday=new JButton("Search Birthday");
cmd_SearchPno=new JButton("Search Phone No.");
cmd_SearchEmail=new JButton("Search Email");
cmd_SearchAdd=new JButton("Search Address");
cmd_SearchAnn=new JButton("Search Anniversary");
cmd_SearchRem=new JButton("Search Reminder");
cmd_Back=new JButton("Back");
getContentPane().setLayout(new BorderLayout());
JPanel panel1=new JPanel();
JPanel panelA=new JPanel();
JPanel panelB=new JPanel();
JPanel panel2=new JPanel();
panel2.setLayout(new BorderLayout());
panel1.setLayout(new GridLayout(7,1,10,5));
panel1.add(cmd_SearchAdd);
panel1.add(cmd_SearchEmail);
panel1.add(cmd_SearchPno);
panel1.add(cmd_SearchBday);
panel1.add(cmd_SearchAnn);
panel1.add(cmd_SearchRem);
panel1.add(cmd_Back);
panelA.setLayout(new FlowLayout(FlowLayout.CENTER));
panelB.setLayout(new FlowLayout(FlowLayout.CENTER));
panelA.add(new JLabel("B. R. Enterprises"));
panelB.add(new JLabel("Menu For Searching Corresponding Details"));
panel2.add(panelA,BorderLayout.NORTH);
panel2.add(panelB,BorderLayout.CENTER);
cmd_SearchAdd.addActionListener(this);
cmd_SearchEmail.addActionListener(this);
cmd_SearchPno.addActionListener(this);
cmd_SearchBday.addActionListener(this);
cmd_SearchAnn.addActionListener(this);
cmd_SearchRem.addActionListener(this);
cmd_Back.addActionListener(this);
getContentPane().add(panel2,BorderLayout.NORTH);
getContentPane().add(panel1,BorderLayout.CENTER);
addWindowListener(new MyWindowAdapter());
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==cmd_SearchAdd)
{
SearchAddr addform=new SearchAddr("Search Address Form");
addform.setSize(300,300);
addform.setResizable(false);
addform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_SearchEmail)
{
SearchEmail mailform=new SearchEmail("Search Email Form");
mailform.setLocation(this.getX(),this.getY());
mailform.setSize(300,300);
mailform.setResizable(false);
mailform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_SearchPno)
{
SearchPhone phform=new SearchPhone("Search Phone No. Form");
phform.setLocation(this.getX(),this.getY());
phform.setSize(300,300);
phform.setResizable(false);
phform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_SearchBday)
{
SearchBirthdayForm sbform=new SearchBirthdayForm("Search Birthday Form");
sbform.setLocation(this.getX(),this.getY());
sbform.setSize(300,350);
sbform.setResizable(false);
sbform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_SearchAnn)
{
SearchAnnivForm saform=new SearchAnnivForm("Search Anniversary Form");
saform.setLocation(this.getX(),this.getY());
saform.setSize(300,350);
saform.setResizable(false);
saform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_SearchRem)
{
SearchRemindForm srform=new SearchRemindForm("Search Reminder Form");
srform.setLocation(this.getX(),this.getY());
srform.setSize(300,350);
srform.setResizable(true);
srform.setVisible(true);
setVisible(false);
}
else if(ae.getSource()==cmd_Back)
{
setVisible(false);
MainForm mform=new MainForm("Main Form");
mform.setSize(300,300);
mform.setResizable(false);
mform.setVisible(true);
dispose();
}
}
class MyWindowAdapter extends WindowAdapter
{
public void windowClosing(WindowEvent we)
{
setVisible(false);
MainForm mform=new MainForm("Main Form");
mform.setSize(300,300);
mform.setResizable(false);
mform.setVisible(true);
dispose();
}
}
}