JLibrary Managment System Documentation
JLibrary Managment System Documentation
JLibrary Managment System Documentation
Java Project
LIBRARY MANAGEMENT SYSTEM DOCUMENTATION
Introduction
There are 10 java files within the project each defining the GUI composition and database
Connection of the project. This project is prepared to facilitate and improve the way our university
library work and it can be optimize the regulation of this but in this documentation, we are not going to
explain how to use the software instated we will focus on explaining how each segment of code is used
to achieve respective task performed by the software.
Classes
There are several classes in jdk for so many purposes with well-equipped documentation but
they are not the only classes available for programmers since now a day thanks to internet we have to
many development teams and talented individuals all over the world contributing countless classes with
solutions for previously unavailable problems making the programing world efficient and fast. So, we
used both internal jdk and external custom classes to prepare the software. I group this classes in to two
and they are listed below.
Custom Classes
1. For Theme
a. import com.jtattoo.plaf.aluminium.AluminiumLookAndFeel;
b. import com.jtattoo.plaf.hifi.HiFiLookAndFeel;
c. import com.jtattoo.plaf.mcwin.McWinLookAndFeel;
Source code For each GUI form and the hole Project
Home
package ADU_School_project;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.JOptionPane;
import javax.swing.UnsupportedLookAndFeelException;
public class Home extends javax.swing.JFrame {
int glob=1;
if(glob!=0){
if(elapseT==0){
return true;
}if(elapseT==1){
int y = 60 - initials;
int elapsed=minute+y;
if(elapsed<60){
return true;
}else{
return false;
}}else{return false; }
}else{return true; }}
cheak.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ADU_School_project/New.png")));
int x = type.getSelectedIndex();
if(x==0){
choice = "title";
}else if(x==1){
choice = "id";
} else if(x==2){
choice = "auter";
} else if(x==3){
choice = "collage";
} else{
choice = "department";
}}
public Home() {
initComponents();
feed = "no";
choice = "title";
conn = db.java_db();
p6 = new javax.swing.JPanel();
jLabel10 = new javax.swing.JLabel();
p2 = new javax.swing.JPanel();
p3 = new javax.swing.JPanel();
p4 = new javax.swing.JPanel();
p1 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Home");
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel10.setText("Librery managment");
jButton2.setText("Logout");
jButton2.addActionListener(new java.awt.event.ActionListener() {
jButton2ActionPerformed(evt);
});
p6.setLayout(p6Layout);
p6Layout.setHorizontalGroup(
p6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p6Layout.createSequentialGroup()
.add(jLabel10, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2)
);
p6Layout.setVerticalGroup(
p6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p6Layout.createSequentialGroup()
.add(p6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p6Layout.createSequentialGroup()
.addContainerGap()
.add(p6Layout.createSequentialGroup()
.add(0, 0, Short.MAX_VALUE))
);
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel3.setText("Department :");
jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel4.setText("Time :");
nam.setEditable(false);
time.setEnabled(false);
dep.setEditable(false);
p2.setLayout(p2Layout);
p2Layout.setHorizontalGroup(
p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, p2Layout.createSequentialGroup()
.add(p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(p2Layout.createSequentialGroup()
.add(jLabel3)
.add(dep))
.add(org.jdesktop.layout.GroupLayout.LEADING, p2Layout.createSequentialGroup()
.add(nam))
.add(org.jdesktop.layout.GroupLayout.LEADING, p2Layout.createSequentialGroup()
.add(16, 16, 16)
);
p2Layout.setVerticalGroup(
p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p2Layout.createSequentialGroup()
.addContainerGap(91, Short.MAX_VALUE)
.add(p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(dep))
.add(p2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
collage.setEnabled(false);
p3.setLayout(p3Layout);
p3Layout.setHorizontalGroup(
p3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p3Layout.createSequentialGroup()
.addContainerGap()
.add(jLabel5)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
);
p3Layout.setVerticalGroup(
p3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p3Layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(p3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel6.setText("Name :");
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel8.setText("ID:");
appruve.setText("Approve");
appruve.addActionListener(new java.awt.event.ActionListener() {
appruveActionPerformed(evt);
});
sid.addKeyListener(new java.awt.event.KeyAdapter() {
sidKeyReleased(evt);
});
returning.setText("Return");
returning.addActionListener(new java.awt.event.ActionListener() {
returningActionPerformed(evt);
}
});
p4.setLayout(p4Layout);
p4Layout.setHorizontalGroup(
p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, p4Layout.createSequentialGroup()
.addContainerGap()
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p4Layout.createSequentialGroup()
.add(rip, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(p4Layout.createSequentialGroup()
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jLabel8, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jLabel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(9, 9, 9)))
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p4Layout.createSequentialGroup()
.add(cheak, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(p4Layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(returning, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 115,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(p4Layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, sid)
.add(sname))))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
p4Layout.setVerticalGroup(
p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p4Layout.createSequentialGroup()
.addContainerGap()
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(sid))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(p4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(rip, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, returning,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel1Layout.createSequentialGroup()
.add(p2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 0, 0)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(p4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.add(0, 0, 0)
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(p2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel1Layout.createSequentialGroup()
.add(p3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(0, 0, 0)
.add(p4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.add(0, 0, 0))
);
student_id.addKeyListener(new java.awt.event.KeyAdapter() {
student_idKeyReleased(evt);
});
type.addActionListener(new java.awt.event.ActionListener() {
typeActionPerformed(evt);
});
p1.setLayout(p1Layout);
p1Layout.setHorizontalGroup(
p1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p1Layout.createSequentialGroup()
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
p1Layout.setVerticalGroup(
p1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, p1Layout.createSequentialGroup()
.addContainerGap(25, Short.MAX_VALUE)
.add(p1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
.add(type)
.addContainerGap())
);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel5Layout.createSequentialGroup()
.add(p1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 0, 0)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(0, 0, 0))
);
jMenuBar1.setFocusable(false);
jMenu1.setText("File");
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
jMenuItem1ActionPerformed(evt);
});
jMenu1.add(jMenuItem1);
jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
jMenuItem11.setText("Option");
jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
jMenuItem11ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem11);
jMenu1.add(jSeparator3);
jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E,
java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
jMenuItem3.setText("Exit");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
jMenuItem3ActionPerformed(evt);
});
jMenu1.add(jMenuItem3);
jMenuBar1.add(jMenu1);
jMenu6.setText("Help");
about.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
about.setText("About");
about.addActionListener(new java.awt.event.ActionListener() {
aboutActionPerformed(evt);
});
jMenu6.add(about);
jMenuBar1.add(jMenu6);
setJMenuBar(jMenuBar1);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 0, 0)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(p6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createSequentialGroup()
.add(0, 0, 0)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.add(0, 0, 0))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(p6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 0, 0)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
String feed;
n.setVisible(true);
log.setVisible(true);
this.dispose();
this.dispose();
add.setVisible(true);
signichure = "option";
conferm.setVisible(true);
try{
pst = conn.prepareStatement(sql);
pst.setString(1,student_id.getText());
rs=pst.executeQuery();
while(rs.next()){
nam.setText(rs.getString("title"));
dep.setText(rs.getString("department"));
collage.setSelectedItem(rs.getString("collage"));
}
pst.close();
rs.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
int cheaker = 0;
try{
pst= conn.prepareStatement(sql);
pst.setString(1,sid.getText());
pst.execute();
sname.setText("");
sid.setText("");
pst.close();
rs.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
} }
int h=0;
try{
pst = conn.prepareStatement(sql);
pst.setString(1,sid.getText());
rs=pst.executeQuery();
nam.setText(rs.getString("last_book_name"));
dep.setText(rs.getString("department"));
if(timer(Integer.parseInt(add2),Integer.parseInt(add3),glob)==false){
h=1;
sname.setText(add1);
if(h!=1){
this.appruve.setEnabled(false);
returning.setEnabled(true);
pst.close();
rs.close();
sname.setText("");
this.appruve.setEnabled(true);
this.returning.setEnabled(false);
}
try{
pst = conn.prepareStatement(sq);
pst.setString(1,sname.getText());
pst.setString(2,sid.getText());
pst.setString(3,nam.getText());
pst.setString(4,the_time);
pst.setString(5,dep.getText());
pst.setString(6,feed);
pst.setString(7,collage.getSelectedItem().toString());
pst.setString(8,""+Time);
pst.setString(9,""+minute);
sname.setText("");
sid.setText("");
dep.setText("");
nam.setText("");
sid.setText("");
pst.execute();
pst.close();
rs.close();
}catch(SQLException e){
}
}
try {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}}
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.awt.EventQueue.invokeLater(new Runnable() {
new Home().setVisible(true);
});
}
private javax.swing.JMenuItem about;
package ADU_School_project;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.UnsupportedLookAndFeelException;
ResultSet rs = null;
public Loger() {
initComponents();
conn = db.java_db();
int numb=0;
if(numb==3){
dispose();
jMenu1.setText("jMenu1");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Security Login");
setResizable(false);
logholder.setBackground(new java.awt.Color(225, 225, 225));
logholder.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "",
javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION,
new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(102, 102, 102))); // NOI18N
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel1.setText(" Name");
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel2.setText(" Password");
name.addActionListener(new java.awt.event.ActionListener() {
nameActionPerformed(evt);
});
login.setText("Login");
login.addActionListener(new java.awt.event.ActionListener() {
loginActionPerformed(evt);
});
choice.setBorder(null);
choice.addActionListener(new java.awt.event.ActionListener() {
choiceActionPerformed(evt);
});
sign.setText("Signup");
sign.addActionListener(new java.awt.event.ActionListener() {
signActionPerformed(evt);
});
logholder.setLayout(logholderLayout);
logholderLayout.setHorizontalGroup(
logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(logholderLayout.createSequentialGroup()
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(logholderLayout.createSequentialGroup()
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(jLabel1)
.add(org.jdesktop.layout.GroupLayout.LEADING, jLabel2,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 95, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(name)
.add(logholderLayout.createSequentialGroup()
.add(login, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
logholderLayout.setVerticalGroup(
logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, logholderLayout.createSequentialGroup()
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1))
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(password, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35,
org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.add(logholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.addContainerGap(71, Short.MAX_VALUE))
);
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 0, 0)
.add(logholder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.add(layout.createSequentialGroup()
.add(0, 0, 0))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(logholder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(0, 0, 0))
);
logholder.getAccessibleContext().setAccessibleName("Login/Signup");
pack();
go.setVisible(true);
if(this.choice.getSelectedItem().equals("Manager")){
String sql = "select id,name,password from manager where(name = ? and password = ? )";
try{
int count = 0;
pst = conn.prepareStatement(sql);
pst.setString(1, name.getText());
pst.setString(2, password.getText());
Transfer.tick2 = name.toString();
rs = pst.executeQuery();
while(rs.next()){
int id = rs.getInt(1);
Transfer.tick = id;
count = count+1;
}if(count == 1){
Transfer.tick1 = "Admin";
main.setVisible(true);
this.dispose();
}else{
if(numb!=2){
name.setForeground(Color.red);
name.setBackground(Color.orange);
logholder.setBackground(Color.orange);
go();
numb++;
password.setForeground(Color.red);
password.setBackground(Color.orange);
password.setText("");
}else{
name.setForeground(Color.black);
setBackground(Color.yellow);
name.setBackground(Color.red);
logholder.setBackground(Color.orange);
numb++;
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}else{
String sql = "select id,name,password from Admin where(name = ? and password = ? )";
if(numb<3){
try{
int count = 0;
pst = conn.prepareStatement(sql);
pst.setString(1, name.getText());
pst.setString(2, password.getText());
Transfer.tick2 = name.toString();
rs = pst.executeQuery();
while(rs.next()){
int id = rs.getInt(1);
Transfer.tick = id;
count = count+1;
}if(count == 1){
Transfer.tick1 = "Admin";
main.setVisible(true);
this.dispose();
}else{
name.setForeground(Color.red);
name.setBackground(Color.yellow);
numb++;
name.setText("");
password.setForeground(Color.red);
password.setBackground(Color.yellow);
password.setText("");
JOptionPane.showMessageDialog(null,"Wrong");
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}else{
dispose();
} }
try {
javax.swing.UIManager.LookAndFeelInfo[]
installedLookAndFeels=javax.swing.UIManager.getInstalledLookAndFeels();
if ("Windows".equals(installedLookAndFeels[idx].getName())) {
javax.swing.UIManager.setLookAndFeel(installedLookAndFeels[idx].getClassName());
break;
java.awt.EventQueue.invokeLater(new Runnable() {
new Loger().setVisible(true);
});
package ADU_School_project;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
ResultSet rs = null;
public Signup_Form() {
initComponents();
setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/ADU_School_project/ico.png")));
conn = db.java_db();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setAlwaysOnTop(true);
setResizable(false);
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel6.setText("Name :");
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel8.setText("Father Name:");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel7.setText("Phone :");
jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14));
name.addActionListener(new java.awt.event.ActionListener() {
nameActionPerformed(evt);
});
phone.addActionListener(new java.awt.event.ActionListener() {
phoneActionPerformed(evt);
});
fname.addActionListener(new java.awt.event.ActionListener() {
fnameActionPerformed(evt);
});
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel10.setText("New Password:");
repasword.addActionListener(new java.awt.event.ActionListener() {
repaswordActionPerformed(evt);
});
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel11.setText("Hint :");
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(name)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(phone)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(st_id, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(repasword)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(st_id, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(0, 9, Short.MAX_VALUE)))
.addGap(0, 0, 0)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addContainerGap())
);
appruve.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ADU_School_project/Checked.png")));
appruve.setText("Approve");
appruve.addActionListener(new java.awt.event.ActionListener() {
appruveActionPerformed(evt);
});
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(87, Short.MAX_VALUE)))
);
pack();
}
private void appruveActionPerformed(java.awt.event.ActionEvent evt) {
Transfer.nam = name.getText();
Transfer.fnam = fname.getText();
Transfer.pon = phone.getText();
Transfer.pas = password.getText();
Transfer.repas = repasword.getText();
signichure = "signup";
conferm.setVisible(true);
this.dispose();
try {
if ("Windows".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.util.logging.Logger.getLogger(Signup_Form.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(Signup_Form.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.util.logging.Logger.getLogger(Signup_Form.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
java.awt.EventQueue.invokeLater(new Runnable() {
new Signup_Form().setVisible(true);
});
package ADU_School_project;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import net.proteanit.sql.DbUtils;
/**
* @author yapone
*/
ResultSet rs = null;
public Option() {
initComponents();
conn = db.java_db();
char aa='m';
update(aa);
/**
* 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
*/
@SuppressWarnings("unchecked")
jLabel3.setToolTipText("");
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setModalExclusionType(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(0, 0, 0))
);
Delete.setText("Remove");
Delete.addActionListener(new java.awt.event.ActionListener() {
DeleteActionPerformed(evt);
}
});
tab.setModel(new javax.swing.table.DefaultTableModel(
},
new String [] {
));
jScrollPane1.setViewportView(tab);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(2, 2, 2))
);
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Table");
jLabel2.setToolTipText("");
choice.setSelectedIndex(2);
choice.addActionListener(new java.awt.event.ActionListener() {
choiceActionPerformed(evt);
}
});
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel5.setText("Chose");
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 43,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
);
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel6.setText("Name :");
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel8.setText("Father Name:");
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel7.setText("Phone :");
name.addActionListener(new java.awt.event.ActionListener() {
nameActionPerformed(evt);
}
});
phone.addActionListener(new java.awt.event.ActionListener() {
phoneActionPerformed(evt);
});
fname.addActionListener(new java.awt.event.ActionListener() {
fnameActionPerformed(evt);
});
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel10.setText("New Password:");
repasword.addActionListener(new java.awt.event.ActionListener() {
repaswordActionPerformed(evt);
});
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
jLabel11.setText("Hint :");
jButton1.setText("Approve");
jButton1.addActionListener(new java.awt.event.ActionListener() {
jButton1ActionPerformed(evt);
}
});
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel9Layout.createSequentialGroup()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 119,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(password, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(phone)
.addComponent(repasword)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel9Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addContainerGap())
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel9Layout.createSequentialGroup()
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addContainerGap(22, Short.MAX_VALUE))))
);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0))
);
pack();
Transfer.nam = name.getText();
Transfer.fnam = fname.getText();
Transfer.pon = phone.getText();
Transfer.pas = password.getText();
Transfer.repas = repasword.getText();
signichure = "Addup";
conferm.setVisible(true);
this.dispose();
int x = this.choice.getSelectedIndex();
if(x==0){
update('b');
}else if(x==1){
update('s');
}else if(x==2){
update('m');
}else{
update('a');
}}
int x = this.choice.getSelectedIndex();
if(x==0){
try{
pst= conn.prepareStatement(sql);
int row=tab.getSelectedRow();
pst.setString(1,sid);
pst.execute();
JOptionPane.showMessageDialog(null,"Deleted!");
update('b');
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}else if(x==1){
try{
pst= conn.prepareStatement(sql);
int row=tab.getSelectedRow();
pst.setString(1,sid);
pst.execute();
JOptionPane.showMessageDialog(null,"Deleted!");
update('s');
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}else if(x==2){
try{
pst= conn.prepareStatement(sql);
int row=tab.getSelectedRow();
pst.setString(1,sid);
pst.execute();
JOptionPane.showMessageDialog(null,"Deleted!");
update('m');
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}else{
try{
pst= conn.prepareStatement(sql);
int row=tab.getSelectedRow();
String sid = (tab.getModel().getValueAt(row, 0)).toString();
pst.setString(1,sid);
pst.execute();
JOptionPane.showMessageDialog(null,"Deleted!");
update('a');
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
try {
if ("Windows".equals(info.getName())) {
System.out.println(Transfer.thime);
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
java.awt.EventQueue.invokeLater(new Runnable() {
new Option().setVisible(true);
});
if ('s'==a){
try{
pst = conn.prepareStatement(sql);
rs=pst.executeQuery();
tab.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}finally {
try{
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}}
}else if ('m'==a){
try{
pst = conn.prepareStatement(sql);
rs=pst.executeQuery();
tab.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}finally {
try{
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}}
}else if ('b'==a){
try{
pst = conn.prepareStatement(sql);
rs=pst.executeQuery();
tab.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}finally {
try{
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}
}else if ('a'==a){
try{
pst = conn.prepareStatement(sql);
rs=pst.executeQuery();
tab.setModel(DbUtils.resultSetToTableModel(rs));
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}finally {
try{
rs.close();
pst.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,e);
}}}}