forked from DaffaTakarai/HacktoberFest2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch.java
172 lines (148 loc) · 6.34 KB
/
Search.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
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package banking;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* @author Mohit_Pc
*/
public class Search extends javax.swing.JFrame {
/**
* Creates new form Search
*/
Connection con=null;
Statement st=null;
public Search() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
lbl1 = new javax.swing.JLabel();
btn_exits = new javax.swing.JButton();
btn_names = new javax.swing.JButton();
btn_accs = new javax.swing.JButton();
btn_amounts = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
txt_errord = new javax.swing.JTextArea();
jLabel1.setText("jLabel1");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setLayout(null);
lbl1.setText("Choose Search Option from the following list");
jPanel1.add(lbl1);
lbl1.setBounds(331, 11, 212, 43);
btn_exits.setText("EXIT");
btn_exits.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_exitsActionPerformed(evt);
}
});
jPanel1.add(btn_exits);
btn_exits.setBounds(379, 72, 100, 23);
btn_names.setText("BY NAME");
btn_names.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btn_namesActionPerformed(evt);
}
});
jPanel1.add(btn_names);
btn_names.setBounds(379, 127, 100, 23);
btn_accs.setText("BY ACCOUNT ID");
jPanel1.add(btn_accs);
btn_accs.setBounds(379, 179, 111, 23);
btn_amounts.setText("BY AMOUNT");
jPanel1.add(btn_amounts);
btn_amounts.setBounds(379, 236, 111, 23);
txt_errord.setColumns(20);
txt_errord.setRows(5);
jScrollPane1.setViewportView(txt_errord);
jPanel1.add(jScrollPane1);
jScrollPane1.setBounds(560, 130, 320, 210);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btn_namesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_namesActionPerformed
// TODO add your handling code here:
if(evt.getSource()==btn_names)
{
setVisible(false);
new NameSearch().setVisible(true);
}
}//GEN-LAST:event_btn_namesActionPerformed
private void btn_exitsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_exitsActionPerformed
// TODO add your handling code here:
if(evt.getSource()==btn_exits)
{
setVisible(false);
new Menu().setVisible(true);
}
}//GEN-LAST:event_btn_exitsActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Search.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Search.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Search.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Search.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Search().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btn_accs;
private javax.swing.JButton btn_amounts;
private javax.swing.JButton btn_exits;
private javax.swing.JButton btn_names;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lbl1;
private javax.swing.JTextArea txt_errord;
// End of variables declaration//GEN-END:variables
}