Sie sind auf Seite 1von 3

package asfear; import

java.sql.Connection;

import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;
public class Search extends javax.swing.JDialog {
String host = "jdbc:mysql://localhost:3306/Project";
public Search(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents

private void initComponents() {

jPanel1 = new javax.swing.JPanel();

jLabel1 = new

javax.swing.JLabel(); jPanel2 = new

javax.swing.JPanel(); jLabel2 = new

javax.swing.JLabel(); jLabel3 =

new javax.swing.JLabel(); jLabel4

= new javax.swing.JLabel();

txtKey = new javax.swing.JTextField();

txtFName = new

javax.swing.JTextField(); txtLName =

new javax.swing.JTextField();

btnClose = new javax.swing.JButton();


btnSearch = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOS

E); setLocation(new java.awt.Point(450, 250));

jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAIS
E D));

jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N


jLabel1.setForeground(new java.awt.Color(0, 51, 102));
jLabel1.setText("SEARCH RECORD OF STUDENTS");

javax.swing.GroupLayout jPanel1Layout = new

javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout);

jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN

G) .addGroup(jPanel1Layout.createSequentialGroup()

.addGap(18, 18, 18)

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 229,


javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(31, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN

G) .addGroup(jPanel1Layout.createSequentialGroup()

.addGap(19, 19, 19)


.addComponent(jLabel1)

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,

Short.MAX_VALUE)) );
jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOW
E RED));

jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N


jLabel2.setText("Enter Id Number");

jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N


jLabel3.setText("Enter First Name");

jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N


jLabel4.setText("Enter Last Name");

txtKey.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N

txtFName.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N

txtLName.setFont(new java.awt.Font("Times New Roman", 0, 12)); // NOI18N

btnClose.setText("Clear");

btnClose.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCloseActionPerformed(evt);
}
});

btnSearch.setText("Search");
btnSearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {