diff --git a/build.xml b/build.xml index 7060b4c..8cf73c6 100644 --- a/build.xml +++ b/build.xml @@ -7,8 +7,8 @@ - - Builds, tests, and runs the project Library_Management_System. + + Builds, tests, and runs the project Library_System. - + @@ -619,7 +619,7 @@ is divided into following sections: - + @@ -716,7 +716,7 @@ is divided into following sections: - + @@ -1057,7 +1057,7 @@ is divided into following sections: - + @@ -1728,7 +1728,7 @@ is divided into following sections: - + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 59d7584..d480333 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=0c87404a -build.xml.script.CRC32=76cd900a +build.xml.data.CRC32=413f6df9 +build.xml.script.CRC32=1daabf32 build.xml.stylesheet.CRC32=f85dc8f2@1.108.0.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=0c87404a -nbproject/build-impl.xml.script.CRC32=754b299a +nbproject/build-impl.xml.data.CRC32=413f6df9 +nbproject/build-impl.xml.script.CRC32=ba3c0f5d nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.108.0.48 diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 5f82809..a27b722 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,13 +3,18 @@ - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/About.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/Home.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/Forgot.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/Statistics.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/javaConnect.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/IssueBook.java - file:/C:/Users/pc/Desktop/javac/Library_Management_System/src/Login.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Statistics.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/ReturnBook.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Login.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/JavaConnect.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Home.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/About.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Forgot.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Signup.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/NewBook.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Students.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/Loading.java + file:/C:/Users/pc/Desktop/javac/Library_System/src/IssueBook.java diff --git a/nbproject/project.properties b/nbproject/project.properties index e8e1411..87830e7 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -28,20 +28,22 @@ debug.test.modulepath=\ dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist -dist.jar=${dist.dir}/Library_Management_System.jar +dist.jar=${dist.dir}/Library_System.jar dist.javadoc.dir=${dist.dir}/javadoc dist.jlink.dir=${dist.dir}/jlink -dist.jlink.output=${dist.jlink.dir}/Library_Management_System +dist.jlink.output=${dist.jlink.dir}/Library_System excludes= file.reference.JTattoo-1.6.13.jar=C:\\Users\\pc\\Documents\\sqlite-jdbc-3.7.2.jar\\JTattoo-1.6.13.jar +file.reference.rs2xml.jar=C:\\Users\\pc\\Documents\\sqlite-jdbc-3.7.2.jar\\rs2xml.jar file.reference.sqlite-jdbc-3.7.2.jar=C:\\Users\\pc\\Documents\\sqlite-jdbc-3.7.2.jar\\sqlite-jdbc-3.7.2.jar file.reference.sqlitejdbc-v056.jar=C:\\Users\\pc\\Documents\\sqlite-jdbc-3.7.2.jar\\sqlitejdbc-v056.jar includes=** jar.compress=false javac.classpath=\ + ${file.reference.JTattoo-1.6.13.jar}:\ ${file.reference.sqlite-jdbc-3.7.2.jar}:\ ${file.reference.sqlitejdbc-v056.jar}:\ - ${file.reference.JTattoo-1.6.13.jar} + ${file.reference.rs2xml.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -76,7 +78,7 @@ jlink.additionalmodules= # The jlink additional command line parameters jlink.additionalparam= jlink.launcher=true -jlink.launcher.name=Library_Management_System +jlink.launcher.name=Library_System main.class=Login manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF diff --git a/nbproject/project.xml b/nbproject/project.xml index 804f06e..4eca20b 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.java.j2seproject - Library_Management_System + Library_System diff --git a/src/About.form b/src/About.form index aee584e..97f11bc 100644 --- a/src/About.form +++ b/src/About.form @@ -3,18 +3,10 @@
- - - - - - - - - - + + @@ -31,120 +23,198 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/About.java b/src/About.java index 8f16115..91cde65 100644 --- a/src/About.java +++ b/src/About.java @@ -25,91 +25,135 @@ public About() { // //GEN-BEGIN:initComponents private void initComponents() { - jLabel1 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jPanel2 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - setBackground(new java.awt.Color(255, 0, 204)); - setForeground(new java.awt.Color(255, 255, 255)); - jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel1.setText("Library Management System"); - - jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel2.setText("Version 1.8"); + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Copyright:@Group3 ICTU 2023"); - jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\lms2.png")); // NOI18N + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); + jLabel6.setText("group3@ictuniversity.edu.cm"); - jLabel5.setText("Contact"); + jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Version 1.8"); - jLabel6.setText("group3@ictuniversity.edu.cm"); + jLabel8.setForeground(new java.awt.Color(255, 255, 255)); + jLabel8.setText("facebook.com/group3.14562"); + + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("Contact"); + jLabel7.setForeground(new java.awt.Color(255, 255, 255)); jLabel7.setText("Facebook"); - jLabel8.setText("facebook.com/group3.14562"); + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Library Management System"); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(jLabel4) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(37, 37, 37) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + jLabel9.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\lms2.png")); // NOI18N + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(157, 157, 157) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel5) .addComponent(jLabel7)) - .addGap(106, 106, 106) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel8) - .addComponent(jLabel6))) - .addGroup(layout.createSequentialGroup() - .addGap(247, 247, 247) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel1) - .addGroup(layout.createSequentialGroup() + .addGap(83, 83, 83) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addComponent(jLabel8)) + .addGap(37, 37, 37)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel9) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(117, 117, 117) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jLabel1))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2) - .addGap(16, 16, 16)) - .addComponent(jLabel3)))) - .addContainerGap(616, Short.MAX_VALUE)) + .addGap(39, 39, 39))) + .addContainerGap()))) ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(14, 14, 14) .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel2) .addGap(18, 18, 18) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3)) - .addComponent(jLabel4)) - .addContainerGap(137, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(jLabel6)) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel5)) + .addGap(28, 28, 28) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(jLabel8)) - .addGap(91, 91, 91)) + .addContainerGap()) + ); + + jPanel2.setBackground(new java.awt.Color(0, 204, 204)); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 143, Short.MAX_VALUE) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + + 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.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)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); - setSize(new java.awt.Dimension(1234, 305)); - setLocationRelativeTo(null); + pack(); }// //GEN-END:initComponents /** @@ -156,5 +200,8 @@ public void run() { private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; // End of variables declaration//GEN-END:variables } diff --git a/src/information b/src/Data similarity index 57% rename from src/information rename to src/Data index fa316d9..1925abe 100644 Binary files a/src/information and b/src/Data differ diff --git a/src/Data.sqlite b/src/Data.sqlite new file mode 100644 index 0000000..aec05bc Binary files /dev/null and b/src/Data.sqlite differ diff --git a/src/Forgot.form b/src/Forgot.form index d2f7172..47e38a1 100644 --- a/src/Forgot.form +++ b/src/Forgot.form @@ -4,17 +4,12 @@ - - - - + - - - - + + @@ -32,236 +27,264 @@ - - + + + + - + + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Forgot.java b/src/Forgot.java index 83ede75..2dd167a 100644 --- a/src/Forgot.java +++ b/src/Forgot.java @@ -1,4 +1,9 @@ +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import javax.swing.JOptionPane; /* @@ -11,23 +16,59 @@ * @author pc */ public class Forgot extends javax.swing.JFrame { +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form Forgot */ public Forgot() { - + super("Forgot Password"); initComponents(); - + conn = JavaConnect.ConnerDb(); + + } + public void Search() { + String a1 = jTextField1.getText(); + String sql = "select * from Information where Username=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField2.setText(rs.getString("Name")); + jTextField3.setText(rs.getString("Security Question")); + rs.close(); + pst.close(); + } else { + JOptionPane.showMessageDialog(null, "Incorrect username"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); } -public void Search() { - } public void Retrieve() { - + String a1 = jTextField1.getText(); + String a2 = jTextField4.getText(); + String sql = "select * from Information where Username=? and Answer=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + pst.setString(2, a2); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField5.setText(rs.getString("Password")); + } else { + JOptionPane.showMessageDialog(null, "Incorrect answer"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } } + /** * 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 @@ -37,158 +78,164 @@ public void Retrieve() { // //GEN-BEGIN:initComponents private void initComponents() { - jPanel3 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); - jLabel3 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - jButton2 = new javax.swing.JButton(); - jButton3 = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + jButton1 = new javax.swing.JButton(); jTextField2 = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); jTextField5 = new javax.swing.JTextField(); - jTextField1 = new javax.swing.JTextField(); + jTextField4 = new javax.swing.JTextField(); + jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); - jLabel2 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); - jTextField4 = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jButton3 = new javax.swing.JButton(); + jTextField1 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - setBackground(new java.awt.Color(0, 0, 255)); - setIconImages(null); + setBackground(new java.awt.Color(51, 51, 51)); - jPanel3.setBackground(new java.awt.Color(255, 255, 255)); - - jPanel1.setBackground(new java.awt.Color(255, 255, 255)); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 51, 204)), "Forgot Password", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(255, 0, 0))); // NOI18N - - jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel3.setText(" Security Question"); + jPanel1.setBackground(new java.awt.Color(0, 204, 204)); - jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel5.setText("Password"); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\retrieve.png")); // NOI18N - jButton2.setText("Retrieve"); - jButton2.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton2ActionPerformed(evt); - } - }); + jPanel2.setBackground(new java.awt.Color(51, 51, 51)); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Forgot", 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, 255))); // NOI18N - jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\back.png")); // NOI18N - jButton3.setText("Back"); - jButton3.addActionListener(new java.awt.event.ActionListener() { + jButton1.setBackground(new java.awt.Color(0, 204, 204)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\search.png")); // NOI18N + jButton1.setText("Search"); + jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton3ActionPerformed(evt); + jButton1ActionPerformed(evt); } }); jTextField2.setEditable(false); + jTextField2.setBackground(new java.awt.Color(0, 204, 204)); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); + jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Name"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("Password"); + jTextField5.setEditable(false); + jTextField5.setBackground(new java.awt.Color(0, 204, 204)); - jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel1.setForeground(new java.awt.Color(0, 0, 0)); - jLabel1.setText("Username"); + jTextField4.setBackground(new java.awt.Color(0, 204, 204)); + jTextField4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField4ActionPerformed(evt); + } + }); - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\search.png")); // NOI18N - jButton1.setText("Search"); - jButton1.addActionListener(new java.awt.event.ActionListener() { + jButton2.setBackground(new java.awt.Color(0, 204, 204)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\retrieve.png")); // NOI18N + jButton2.setText("Retrieve"); + jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jButton1ActionPerformed(evt); + jButton2ActionPerformed(evt); } }); - jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel2.setText("Name"); + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Username"); + + jTextField3.setEditable(false); + jTextField3.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); + jLabel3.setText(" Security Question"); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("Answer"); - jTextField3.setEditable(false); - - jTextField4.addActionListener(new java.awt.event.ActionListener() { + jButton3.setBackground(new java.awt.Color(0, 204, 204)); + jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N + jButton3.setText("Back"); + jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - jTextField4ActionPerformed(evt); + jButton3ActionPerformed(evt); } }); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5) .addComponent(jLabel4) .addComponent(jLabel3) .addComponent(jLabel2) .addComponent(jLabel1)) .addGap(50, 50, 50) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField4, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2) - .addComponent(jButton1) - .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) + .addComponent(jButton1)) + .addContainerGap(211, Short.MAX_VALUE)) ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addGap(25, 25, 25) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(23, 23, 23) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2)) .addGap(23, 23, 23) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton3)) - .addContainerGap(27, Short.MAX_VALUE)) - ); - - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(55, 55, 55) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(58, Short.MAX_VALUE)) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(29, 29, 29) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(48, Short.MAX_VALUE)) + .addContainerGap(54, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); @@ -196,36 +243,41 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 19, Short.MAX_VALUE)) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .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(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); - setSize(new java.awt.Dimension(611, 365)); - setLocationRelativeTo(null); + pack(); }// //GEN-END:initComponents - private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_jTextField2ActionPerformed - private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField4ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed - + Retrieve(); }//GEN-LAST:event_jButton2ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed - + setVisible(false); + Login ob=new Login(); + ob.setVisible(true); + }//GEN-LAST:event_jButton3ActionPerformed + private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField2ActionPerformed + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - + Search(); }//GEN-LAST:event_jButton1ActionPerformed /** @@ -273,7 +325,7 @@ public void run() { private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; diff --git a/src/Home.form b/src/Home.form index 193a137..fc98ac8 100644 --- a/src/Home.form +++ b/src/Home.form @@ -3,6 +3,11 @@
+ + + + + @@ -13,11 +18,17 @@ + + + + + + @@ -30,6 +41,9 @@ + + + @@ -37,18 +51,11 @@ - - - - + - - - - - + @@ -66,24 +73,26 @@ - - - + + - + + + + - + - + @@ -91,16 +100,16 @@ - + - - - - - + + + + + - + @@ -108,35 +117,22 @@ - - + + - - - + + + - + - - - - - - - - - - - - - @@ -145,32 +141,27 @@ - + - - + + + - - - - - - - + + + - - - - - + + + + - - + @@ -180,83 +171,89 @@ + - - - - - - - - - - + + + + + + + - - - + + - + - + - + - + + + + - + - - + + + - + - + - + - + + + + - + - + - + - - + + - + + + - + - + @@ -265,13 +262,29 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -279,76 +292,84 @@ - + - - - + + + + + + + + + - + - - + - + + + + - + - - - - + - + - - - - + - + - - + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - + @@ -357,45 +378,20 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - + + @@ -403,58 +399,25 @@ - + - + - - - - - - - - - - - - + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - + + diff --git a/src/Home.java b/src/Home.java index 924c2b9..349dd00 100644 --- a/src/Home.java +++ b/src/Home.java @@ -1,3 +1,6 @@ + +import javax.swing.JOptionPane; + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -25,26 +28,24 @@ public Home() { // //GEN-BEGIN:initComponents private void initComponents() { - jPanel3 = new javax.swing.JPanel(); + jPanel4 = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + jButton3 = new javax.swing.JButton(); + jLabel7 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jButton2 = new javax.swing.JButton(); + jLabel6 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jButton5 = new javax.swing.JButton(); - jButton4 = new javax.swing.JButton(); + jLabel9 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jButton6 = new javax.swing.JButton(); - jLabel9 = new javax.swing.JLabel(); + jButton4 = new javax.swing.JButton(); jLabel10 = new javax.swing.JLabel(); - jPanel4 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); - jLabel4 = new javax.swing.JLabel(); - jPanel1 = new javax.swing.JPanel(); - jButton3 = new javax.swing.JButton(); - jLabel5 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); @@ -52,25 +53,115 @@ private void initComponents() { jMenu2 = new javax.swing.JMenu(); jMenuItem3 = new javax.swing.JMenuItem(); - setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); - setBackground(new java.awt.Color(0, 153, 153)); + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - jPanel3.setBackground(new java.awt.Color(0, 255, 255)); + jPanel4.setBackground(new java.awt.Color(0, 204, 204)); + + jPanel1.setBackground(new java.awt.Color(0, 0, 0)); + + jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\newstudent.png")); // NOI18N + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jLabel7.setForeground(new java.awt.Color(255, 255, 255)); + jLabel7.setText("NewStudent"); + + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("NewBook"); + + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\statictics.png")); // NOI18N + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); + jLabel6.setText("Statistics"); + + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\newbook.jpg")); // NOI18N + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton1) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(28, 28, 28) + .addComponent(jLabel5))) + .addGap(184, 184, 184) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(27, 27, 27) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel7)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 240, Short.MAX_VALUE) + .addComponent(jButton3))) + .addGap(20, 20, 20)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(9, 9, 9) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jButton2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jLabel7))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel5))) + .addContainerGap()) + ); jPanel2.setBackground(new java.awt.Color(0, 0, 0)); - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 153, 0)), "Action", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(102, 153, 255))); // NOI18N - jButton5.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\return_book.png")); // NOI18N + jButton5.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\return_book.png")); // NOI18N + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5ActionPerformed(evt); + } + }); - jButton4.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\issue_book.png")); // NOI18N + jLabel9.setForeground(new java.awt.Color(255, 255, 255)); + jLabel9.setText("ReturnBook"); jLabel8.setForeground(new java.awt.Color(255, 255, 255)); - jLabel8.setText("Issuebook"); + jLabel8.setText("IssueBook"); - jButton6.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\about.png")); // NOI18N + jButton6.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\about.png")); // NOI18N + jButton6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton6ActionPerformed(evt); + } + }); - jLabel9.setForeground(new java.awt.Color(255, 255, 255)); - jLabel9.setText("Returnbook"); + jButton4.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\issue_book.png")); // NOI18N + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton4ActionPerformed(evt); + } + }); jLabel10.setForeground(new java.awt.Color(255, 255, 255)); jLabel10.setText("About"); @@ -84,62 +175,67 @@ private void initComponents() { .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton4) .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(41, 41, 41) + .addGap(24, 24, 24) .addComponent(jLabel8))) + .addGap(175, 175, 175) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton5) .addGroup(jPanel2Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 132, Short.MAX_VALUE) - .addComponent(jButton5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 108, Short.MAX_VALUE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(109, 109, 109) - .addComponent(jLabel9) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGap(38, 38, 38) + .addComponent(jLabel9))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton6, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jLabel10) - .addGap(58, 58, 58)) - .addComponent(jButton6, javax.swing.GroupLayout.Alignment.TRAILING)) + .addGap(24, 24, 24))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(jButton4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel8)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(jButton6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel10))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 4, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() - .addComponent(jButton5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel9))) - .addContainerGap(19, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton4) + .addComponent(jButton5) + .addComponent(jButton6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(jLabel9) + .addComponent(jLabel10)) + .addContainerGap()) ); - jPanel4.setBackground(new java.awt.Color(102, 255, 255)); - - jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\lms2.png")); // NOI18N + jPanel3.setBackground(new java.awt.Color(0, 255, 255)); - jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel3.setForeground(new java.awt.Color(255, 255, 255)); - jLabel3.setText("to"); + jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Downloads\\rsz_lms2.png")); // NOI18N - jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N - jLabel1.setForeground(new java.awt.Color(255, 255, 255)); - jLabel1.setText("# Welcome"); + jLabel1.setBackground(new java.awt.Color(0, 0, 0)); + jLabel1.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N + jLabel1.setForeground(new java.awt.Color(0, 0, 0)); + jLabel1.setText("LIBRARY MANAGEMENT SYSTEM"); - jLabel4.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N - jLabel4.setForeground(new java.awt.Color(255, 255, 255)); - jLabel4.setText("library Management System"); + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1) + .addContainerGap()) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2)) + .addContainerGap()) + ); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); @@ -147,121 +243,44 @@ private void initComponents() { jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 140, Short.MAX_VALUE) - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jLabel4) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(53, 53, 53) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap()) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() - .addGap(36, 36, 36) - .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(jLabel1) - .addComponent(jLabel4)) - .addGap(81, 81, 81)) - .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) - ); - - jPanel1.setBackground(new java.awt.Color(0, 0, 0)); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "OPeration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(0, 153, 255))); // NOI18N - jPanel1.setForeground(new java.awt.Color(102, 102, 102)); - - jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\newstudent.png")); // NOI18N - - jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel5.setForeground(new java.awt.Color(255, 255, 255)); - jLabel5.setText("Newbook"); - - jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel6.setForeground(new java.awt.Color(255, 255, 255)); - jLabel6.setText("Statistics"); - - jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel7.setForeground(new java.awt.Color(255, 255, 255)); - jLabel7.setText("Newstudent"); - - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\newbook.jpg")); // NOI18N - - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\statictics.png")); // NOI18N - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(30, 30, 30) - .addComponent(jLabel5)) - .addComponent(jButton1)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(75, 75, 75) - .addComponent(jButton2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton3)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(101, 101, 101) - .addComponent(jLabel6) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel7))) - .addGap(6, 6, 6)) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jButton2) - .addComponent(jButton3)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(jLabel7) - .addComponent(jLabel6)) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(75, 75, 75) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap(36, Short.MAX_VALUE) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) - .addContainerGap(35, Short.MAX_VALUE)) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); + jMenuBar1.setBackground(new java.awt.Color(0, 204, 255)); jMenu1.setText("File"); jMenuItem1.setText("Exit"); + jMenuItem1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem1ActionPerformed(evt); + } + }); jMenu1.add(jMenuItem1); jMenuItem2.setText("Logout"); + jMenuItem2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem2ActionPerformed(evt); + } + }); jMenu1.add(jMenuItem2); jMenuBar1.add(jMenu1); @@ -269,6 +288,11 @@ private void initComponents() { jMenu2.setText("Edit"); jMenuItem3.setText("About"); + jMenuItem3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem3ActionPerformed(evt); + } + }); jMenu2.add(jMenuItem3); jMenuBar1.add(jMenu2); @@ -279,19 +303,80 @@ private void initComponents() { getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) ); - setBounds(0, 0, 744, 618); + pack(); }// //GEN-END:initComponents + private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed + setVisible(false); + About ob=new About(); + ob.setVisible(true); + }//GEN-LAST:event_jButton6ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + setVisible(false); + NewBook ob=new NewBook(); + ob.setVisible(true); + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + setVisible(false); + Students ob=new Students(); + ob.setVisible(true); + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed + setVisible(false); + IssueBook ob=new IssueBook(); + ob.setVisible(true); + }//GEN-LAST:event_jButton4ActionPerformed + + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed + setVisible(false); + ReturnBook ob=new ReturnBook(); + ob.setVisible(true); + }//GEN-LAST:event_jButton5ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + String enteredPassword = JOptionPane.showInputDialog(null, "Enter password:"); + String correctPassword = "ICTU"; // Set the correct password here + + if (enteredPassword != null && enteredPassword.equals(correctPassword)) { + setVisible(false); + Statistics ob = new Statistics(); + ob.setVisible(true); + } else { + JOptionPane.showMessageDialog(null, "Invalid password!"); + } + }//GEN-LAST:event_jButton2ActionPerformed + + private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed + System.exit(0); + }//GEN-LAST:event_jMenuItem1ActionPerformed + + private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed + setVisible(false); + Login ob=new Login(); + + ob.setVisible(true); + }//GEN-LAST:event_jMenuItem2ActionPerformed + + private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed + setVisible(false); + About ob=new About(); + ob.setVisible(true); + }//GEN-LAST:event_jMenuItem3ActionPerformed + /** * @param args the command line arguments */ @@ -337,8 +422,6 @@ public void run() { private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; diff --git a/src/IssueBook.form b/src/IssueBook.form index eecac77..0489e58 100644 --- a/src/IssueBook.form +++ b/src/IssueBook.form @@ -1,18 +1,12 @@ - - - - - - - - + + @@ -29,72 +23,20 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + + @@ -102,339 +44,527 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - + - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + + + - - - - - - - + + + + + + - - - - - - - - + + + + + + - - - - - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + - + - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/src/IssueBook.java b/src/IssueBook.java index ed04eb8..e932b43 100644 --- a/src/IssueBook.java +++ b/src/IssueBook.java @@ -1,3 +1,10 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import javax.swing.JOptionPane; + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -8,13 +15,18 @@ * @author pc */ public class IssueBook extends javax.swing.JFrame { - +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form IssueBook */ public IssueBook() { + super("Issue Book"); initComponents(); + conn = JavaConnect.ConnerDb(); } + /** * This method is called from within the constructor to initialize the form. @@ -25,9 +37,8 @@ public IssueBook() { // //GEN-BEGIN:initComponents private void initComponents() { - buttonGroup1 = new javax.swing.ButtonGroup(); - jLabel7 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); jTextField6 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); @@ -41,7 +52,7 @@ private void initComponents() { jTextField4 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); - jPanel2 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); jTextField7 = new javax.swing.JTextField(); jTextField8 = new javax.swing.JTextField(); jTextField13 = new javax.swing.JTextField(); @@ -57,246 +68,402 @@ private void initComponents() { jLabel9 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); - jLabel15 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); - jButton4 = new javax.swing.JButton(); + jButton5 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 204)), "Book Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(255, 51, 204))); // NOI18N + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jPanel2.setBackground(new java.awt.Color(51, 51, 51)); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Book Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N + + jTextField6.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField5.setBackground(new java.awt.Color(0, 204, 204)); + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("Price"); + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("Publisher"); - jLabel2.setText("Name"); + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\search.png")); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Name_"); + + jButton1.setBackground(new java.awt.Color(0, 204, 204)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\search.png")); // NOI18N jButton1.setText("Search"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jTextField3.setBackground(new java.awt.Color(0, 204, 204)); + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("Pages"); - jLabel1.setText("Book ID"); + jTextField2.setBackground(new java.awt.Color(0, 204, 204)); + jTextField4.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Book_id"); + + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Edition"); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel6) .addGap(47, 47, 47) .addComponent(jTextField6)) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel1) .addGap(37, 37, 37) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton1)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel3) .addComponent(jLabel4) .addComponent(jLabel5)) .addGap(29, 29, 29) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addContainerGap()) + .addContainerGap(32, Short.MAX_VALUE)) ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(15, 15, 15) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5) .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(24, 24, 24) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 153)), "Student Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18))); // NOI18N + jPanel3.setBackground(new java.awt.Color(51, 51, 51)); + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 0), "Student Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N + + jTextField7.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField8.setBackground(new java.awt.Color(0, 204, 204)); - jLabel8.setText("Student ID"); + jTextField13.setBackground(new java.awt.Color(0, 204, 204)); + jLabel8.setBackground(new java.awt.Color(0, 204, 204)); + jLabel8.setForeground(new java.awt.Color(255, 255, 255)); + jLabel8.setText("Student_id"); + + jLabel14.setForeground(new java.awt.Color(255, 255, 255)); jLabel14.setText("Semester"); + jTextField12.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel12.setForeground(new java.awt.Color(255, 255, 255)); jLabel12.setText("Branch"); - jLabel10.setText("Father Name"); + jTextField9.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel10.setForeground(new java.awt.Color(255, 255, 255)); + jLabel10.setText("Father_Name"); + + jTextField10.setBackground(new java.awt.Color(0, 204, 204)); - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\search.png")); // NOI18N + jTextField11.setBackground(new java.awt.Color(0, 204, 204)); + + jButton2.setBackground(new java.awt.Color(0, 204, 204)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\search.png")); // NOI18N jButton2.setText("Search"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + jLabel9.setForeground(new java.awt.Color(255, 255, 255)); jLabel9.setText("Name"); + jLabel11.setForeground(new java.awt.Color(255, 255, 255)); jLabel11.setText("Course"); + jLabel13.setForeground(new java.awt.Color(255, 255, 255)); jLabel13.setText("Year"); - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() .addGap(98, 98, 98) .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel8) .addGap(43, 43, 43) - .addComponent(jTextField7)) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField7, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel10) - .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createSequentialGroup() .addGap(8, 8, 8) .addComponent(jLabel9))) .addGap(30, 30, 30) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField8) .addComponent(jTextField9)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jLabel14) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel11) .addComponent(jLabel12) .addComponent(jLabel13)) .addGap(55, 55, 55))) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField12) .addComponent(jTextField11) .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addComponent(jButton2)) ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel8) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2))) .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9)) .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel10) .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11)) .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12) .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14) .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); - jLabel15.setText("Date of issue"); - - jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\issuecon.png")); // NOI18N + jButton3.setBackground(new java.awt.Color(0, 204, 204)); + jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\issuecon.png")); // NOI18N jButton3.setText("Issue"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); - jButton4.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\back.png")); // NOI18N - jButton4.setText("Back"); + jButton5.setBackground(new java.awt.Color(0, 204, 204)); + jButton5.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N + jButton5.setText("back"); + jButton5.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap(337, Short.MAX_VALUE) + .addComponent(jButton3) + .addGap(50, 50, 50) + .addComponent(jButton5) + .addGap(112, 112, 112)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap(335, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton3) + .addComponent(jButton5)) + .addContainerGap()) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(60, Short.MAX_VALUE))) + ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel7) - .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) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jButton3) - .addGap(52, 52, 52) - .addComponent(jButton4)) - .addComponent(jLabel15)))))) - .addContainerGap(318, Short.MAX_VALUE)) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jLabel15) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton3) - .addComponent(jButton4)) - .addGap(168, 168, 168) - .addComponent(jLabel7) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); - setSize(new java.awt.Dimension(958, 555)); - setLocationRelativeTo(null); + pack(); }// //GEN-END:initComponents + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + try { + String sql = "INSERT INTO IssueBook(Book_id,Name_, Edition, Publisher, Price, Pages,Student_id,Name,Father_Name,Course,Branch,Year,Semester) VALUES(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?)"; + pst = conn.prepareStatement(sql); + pst.setString(1, jTextField1.getText()); + pst.setString(2, jTextField2.getText()); + pst.setString(3, jTextField3.getText()); + pst.setString(4, jTextField4.getText()); + pst.setString(5, jTextField5.getText()); + pst.setString(6, jTextField6.getText()); + pst.setString(7, jTextField7.getText()); + pst.setString(8, jTextField8.getText()); + pst.setString(9, jTextField9.getText()); + pst.setString(10, jTextField10.getText()); + pst.setString(11, jTextField11.getText()); + pst.setString(12, jTextField12.getText()); + pst.setString(13, jTextField13.getText()); + pst.execute(); + JOptionPane.showMessageDialog(null, "Book has been Issue Successfully!"); + rs.close(); + pst.close(); +} catch (SQLException e) { + JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); +} finally { + try { + if (pst != null) { + pst.close(); + } + } catch (SQLException e) { + // Handle the exception if closing the prepared statement fails + } +} + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed + setVisible(false); + Home ob=new Home(); + ob.setVisible(true); + }//GEN-LAST:event_jButton5ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + String a1 = jTextField1.getText(); + String sql = "select * from NewBook where Book_id=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField2.setText(rs.getString("Name")); + jTextField3.setText(rs.getString("Edition")); + jTextField4.setText(rs.getString("Publisher")); + jTextField5.setText(rs.getString("Price")); + jTextField6.setText(rs.getString("Pages")); + rs.close(); + pst.close(); + } else { + JOptionPane.showMessageDialog(null, "Incorrect ID"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } + + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + String a1 = jTextField7.getText(); + String sql = "select * from NewStudent where Student_id=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField8.setText(rs.getString("Name")); + jTextField9.setText(rs.getString("Father_Name")); + jTextField10.setText(rs.getString("Course")); + jTextField11.setText(rs.getString("Branch")); + jTextField12.setText(rs.getString("Year")); + jTextField13.setText(rs.getString("Semester")); + rs.close(); + pst.close(); + } else { + JOptionPane.showMessageDialog(null, "Incorrect ID"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } + }//GEN-LAST:event_jButton2ActionPerformed + /** * @param args the command line arguments */ @@ -333,28 +500,26 @@ public void run() { } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; - private javax.swing.JButton jButton4; + private javax.swing.JButton jButton5; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; - private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField10; private javax.swing.JTextField jTextField11; diff --git a/src/javaConnect.java b/src/JavaConnect.java similarity index 87% rename from src/javaConnect.java rename to src/JavaConnect.java index 5a92511..938f3be 100644 --- a/src/javaConnect.java +++ b/src/JavaConnect.java @@ -1,4 +1,8 @@ - /* + +import javax.swing.JOptionPane; +import java.sql.*; + +/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ @@ -7,11 +11,8 @@ * * @author pc */ -import java.sql.*; -import javax.swing.JOptionPane; - -public class javaConnect { - Connection conn; +public class JavaConnect { + Connection conn; public static Connection ConnerDb(){ try{ Class.forName("org.sqlite.JDBC"); @@ -24,3 +25,5 @@ public static Connection ConnerDb(){ } } + + diff --git a/src/Loading.form b/src/Loading.form index cc214b9..79d5c2f 100644 --- a/src/Loading.form +++ b/src/Loading.form @@ -5,10 +5,8 @@ - - - - + + @@ -25,32 +23,20 @@ - - - - - + - - - - - + - - - - - - + + @@ -58,55 +44,39 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + - - + + - + - + - - - - - - - - - diff --git a/src/Loading.java b/src/Loading.java index 200a689..d90c753 100644 --- a/src/Loading.java +++ b/src/Loading.java @@ -3,8 +3,6 @@ import javax.swing.JOptionPane; - - /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -15,25 +13,44 @@ * @author pc */ public class Loading extends javax.swing.JFrame implements Runnable{ - +Connection conn; + int s=0; + Thread th; /** * Creates new form Loading */ public Loading() { - + super("Loading"); initComponents(); - + th=new Thread((Runnable)this); + } public void setUpLoading(){ - + setVisible(false); + th.start(); } public void run(){ - + try{ + for(int i=1;i<=200;i++){ + s=s+1; + int m=jProgressBar2.getMaximum(); + int v=jProgressBar2.getValue(); + if(v//GEN-END:initComponents /** @@ -150,7 +150,7 @@ public static void main(String args[]) { /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { - + new Loading().setVisible(true); } }); } @@ -158,7 +158,6 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel4; private javax.swing.JPanel jPanel1; private javax.swing.JProgressBar jProgressBar2; // End of variables declaration//GEN-END:variables diff --git a/src/Login.form b/src/Login.form index dcab99b..1e3f987 100644 --- a/src/Login.form +++ b/src/Login.form @@ -1,6 +1,10 @@
+ + + + @@ -23,26 +27,26 @@ - - - - + - + - + + + + - - + + @@ -53,122 +57,160 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - + + + + - - + + + + + - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Login.java b/src/Login.java index 56d9084..b575e7b 100644 --- a/src/Login.java +++ b/src/Login.java @@ -1,3 +1,12 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import javax.swing.JOptionPane; +import javax.swing.UIManager; + + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -8,12 +17,18 @@ * @author pc */ public class Login extends javax.swing.JFrame { +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form Login */ public Login() { + super("Login"); initComponents(); + conn = JavaConnect.ConnerDb(); + } /** @@ -25,32 +40,64 @@ public Login() { // //GEN-BEGIN:initComponents private void initComponents() { - jPanel2 = new javax.swing.JPanel(); + jScrollBar1 = new javax.swing.JScrollBar(); jPanel1 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - jTextField1 = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); - jTextField2 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jPasswordField1 = new javax.swing.JPasswordField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Login", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 24), new java.awt.Color(102, 255, 255))); // NOI18N - - jLabel1.setText("Username"); + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Login", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(51, 153, 255))); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Password"); - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\login.png")); // NOI18N + jButton1.setBackground(new java.awt.Color(0, 153, 153)); + jButton1.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\login.png")); // NOI18N jButton1.setText("login"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\signup.png")); // NOI18N + jButton2.setBackground(new java.awt.Color(0, 153, 153)); + jButton2.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\signup.png")); // NOI18N jButton2.setText("signup"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); - jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\forgot.png")); // NOI18N + jButton3.setBackground(new java.awt.Color(0, 153, 153)); + jButton3.setFont(new java.awt.Font("Segoe UI", 1, 12)); // NOI18N + jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\forgot.png")); // NOI18N jButton3.setText("Forgot"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Username"); + + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel3.setForeground(new java.awt.Color(255, 51, 51)); + jLabel3.setText("trouble shooting..."); + + jPasswordField1.setBackground(new java.awt.Color(0, 204, 204)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -58,25 +105,30 @@ private void initComponents() { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1) - .addGap(74, 74, 74) - .addComponent(jTextField1)) + .addGap(108, 108, 108) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2) + .addComponent(jLabel1)) + .addGap(69, 69, 69) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 55, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel2) - .addGap(77, 77, 77) - .addComponent(jTextField2)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE) - .addComponent(jButton1) - .addGap(49, 49, 49) - .addComponent(jButton2))) - .addContainerGap()) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton3) - .addGap(57, 57, 57)) + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jButton1) + .addComponent(jLabel3)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(70, 70, 70) + .addComponent(jButton2)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(34, 34, 34) + .addComponent(jButton3))) + .addGap(75, 75, 75)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -85,52 +137,83 @@ private void initComponents() { .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGap(43, 43, 43) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(88, 88, 88) + .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(39, 39, 39) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) - .addGap(34, 34, 34) - .addComponent(jButton3) - .addContainerGap(7, Short.MAX_VALUE)) - ); - - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, 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(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 78, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton3) + .addComponent(jLabel3)) + .addGap(38, 38, 38)) ); 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(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 83, Short.MAX_VALUE)) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// //GEN-END:initComponents + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + setVisible(false); + Signup ob=new Signup(); + ob.setVisible(true); + + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + setVisible(false); + Forgot ob=new Forgot(); + ob.setVisible(true); + + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + String sql = "select * from Information where Username=? and Password=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, jTextField1.getText()); + pst.setString(2, jPasswordField1.getText()); + rs = pst.executeQuery(); + if (rs.next()) { + rs.close(); + pst.close(); + + setVisible(false); + Loading ob=new Loading(); + ob.setUpLoading(); + ob.setVisible(true); + + }else { + JOptionPane.showMessageDialog(null, "Incorrect username and password"); + } + + } + catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + }finally{ + try{ + rs.close(); + pst.close(); + }catch(Exception e){ + + } + } + + }//GEN-LAST:event_jButton1ActionPerformed + /** * @param args the command line arguments */ @@ -142,11 +225,13 @@ public static void main(String args[]) { */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { - javax.swing.UIManager.setLookAndFeel(info.getClassName()); - break; - } +// if ("Nimbus".equals(info.getName())) { +// javax.swing.UIManager.setLookAndFeel(info.getClassName()); +// break; + } + UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel"); + } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { @@ -172,9 +257,10 @@ public void run() { private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; + private javax.swing.JPasswordField jPasswordField1; + private javax.swing.JScrollBar jScrollBar1; private javax.swing.JTextField jTextField1; - private javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables } diff --git a/src/NewBook.form b/src/NewBook.form index 364dd0c..dbf1a19 100644 --- a/src/NewBook.form +++ b/src/NewBook.form @@ -5,10 +5,8 @@ - - - - + + @@ -25,19 +23,14 @@ - - - - - + - - + + - @@ -45,13 +38,8 @@ - - - - - - - + + @@ -89,8 +77,8 @@ - - + + @@ -101,7 +89,7 @@ - + @@ -135,10 +123,10 @@ - - + + - + @@ -149,40 +137,82 @@ - + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + + + + + + + - + + + + + + + + + - + - - + + - - + - - + + - + + + + + + + + + + + @@ -190,56 +220,72 @@ + + + + + + - + + + + + + + + + + + + + + + + + + - + + + + - - - + - + + + + - - - - - + - - - - - - - - - - + + + + + + - - - diff --git a/src/NewBook.java b/src/NewBook.java index 1e88d2b..f5cf0a7 100644 --- a/src/NewBook.java +++ b/src/NewBook.java @@ -1,3 +1,11 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Random; +import javax.swing.JOptionPane; + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -8,12 +16,22 @@ * @author pc */ public class NewBook extends javax.swing.JFrame { - +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form NewBook */ public NewBook() { + super("NewBook"); initComponents(); + conn = JavaConnect.ConnerDb(); + Random(); + + } + public void Random(){ + Random rd=new Random(); + jTextField1.setText(""+rd.nextInt(1000+1)); } /** @@ -26,50 +44,79 @@ public NewBook() { private void initComponents() { jPanel1 = new javax.swing.JPanel(); + jComboBox1 = new javax.swing.JComboBox<>(); + jTextField4 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); - jLabel6 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); + jTextField1 = new javax.swing.JTextField(); + jTextField6 = new javax.swing.JTextField(); + jLabel6 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); + jButton1 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); - jTextField6 = new javax.swing.JTextField(); - jLabel4 = new javax.swing.JLabel(); - jTextField4 = new javax.swing.JTextField(); - jTextField1 = new javax.swing.JTextField(); - jComboBox1 = new javax.swing.JComboBox<>(); + jLabel5 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "NewBook", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(255, 51, 255))); // NOI18N + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); - jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel6.setText("Pages"); + jComboBox1.setBackground(new java.awt.Color(0, 204, 204)); + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1", "2", "3", "4", "5", "6", "7" })); - jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel2.setText("Name"); + jTextField4.setBackground(new java.awt.Color(0, 204, 204)); - jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel5.setText("Price"); + jTextField5.setBackground(new java.awt.Color(0, 204, 204)); - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\add.png")); // NOI18N - jButton1.setText("Add"); + jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); + jLabel4.setText("Publisher"); + + jTextField2.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField6.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); + jLabel6.setText("Pages"); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Edition"); - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\back.png")); // NOI18N + jButton2.setBackground(new java.awt.Color(0, 204, 204)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N jButton2.setText("Back"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jButton1.setBackground(new java.awt.Color(0, 204, 204)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\create.png")); // NOI18N + jButton1.setText("Add"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel1.setText("Book ID"); + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Book_id"); - jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel4.setText("Publisher"); + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("Price"); - jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "1", "2", "3", "4", "5", "6", "7" })); + jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Name"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -108,7 +155,7 @@ private void initComponents() { .addComponent(jButton1) .addGap(50, 50, 50) .addComponent(jButton2))) - .addContainerGap()) + .addContainerGap(206, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -137,7 +184,7 @@ private void initComponents() { .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6) .addComponent(jTextField6, 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) @@ -148,23 +195,51 @@ private void initComponents() { getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(81, Short.MAX_VALUE)) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addGap(19, 19, 19) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(23, 23, 23)) + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - setSize(new java.awt.Dimension(416, 333)); - setLocationRelativeTo(null); + pack(); }// //GEN-END:initComponents + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + setVisible(false); + Home ob=new Home(); + ob.setVisible(true); + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + try { + String sql = "INSERT INTO NewBook(Book_id,Name, Edition, Publisher, Price, Pages) VALUES(?, ?, ?, ?, ?,?)"; + pst = conn.prepareStatement(sql); + pst.setString(1, jTextField1.getText()); + pst.setString(2, jTextField2.getText()); + pst.setString(3, (String) jComboBox1.getSelectedItem()); + pst.setString(4, jTextField4.getText()); + pst.setString(5, jTextField5.getText()); + pst.setString(6, jTextField6.getText()); + pst.execute(); + JOptionPane.showMessageDialog(null, "New Book has been added!"); + rs.close(); + pst.close(); +} catch (SQLException e) { + JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); +} finally { + try { + if (pst != null) { + pst.close(); + } + } catch (SQLException e) { + // Handle the exception if closing the prepared statement fails + } +} + }//GEN-LAST:event_jButton1ActionPerformed + /** * @param args the command line arguments */ diff --git a/src/ReturnBook.form b/src/ReturnBook.form index 23d7678..fbb3e72 100644 --- a/src/ReturnBook.form +++ b/src/ReturnBook.form @@ -1,14 +1,22 @@ + + + + + + + + + + - - - - + + @@ -25,54 +33,29 @@ - - - - - - - - - - - - - - - + + - - - - - - - - - - - + - + + + + - - - - - - + @@ -81,304 +64,540 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + - + - - + + - - - - - - + - - - - - - - - - - + - + + + + + + + - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - + - + + + + + + + + + + - + - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ReturnBook.java b/src/ReturnBook.java index 49b384b..917d76c 100644 --- a/src/ReturnBook.java +++ b/src/ReturnBook.java @@ -1,3 +1,10 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import javax.swing.JOptionPane; + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -8,12 +15,16 @@ * @author pc */ public class ReturnBook extends javax.swing.JFrame { - +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form ReturnBook */ public ReturnBook() { + super("Return Book"); initComponents(); + conn = JavaConnect.ConnerDb(); } /** @@ -25,76 +36,228 @@ public ReturnBook() { // //GEN-BEGIN:initComponents private void initComponents() { - jPanel1 = new javax.swing.JPanel(); + jLabel15 = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + jButton2 = new javax.swing.JButton(); + jPanel2 = new javax.swing.JPanel(); + jTextField7 = new javax.swing.JTextField(); jTextField4 = new javax.swing.JTextField(); - jLabel13 = new javax.swing.JLabel(); - jTextField3 = new javax.swing.JTextField(); - jLabel1 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - jTextField15 = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); + jLabel20 = new javax.swing.JLabel(); + jTextField2 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); - jLabel2 = new javax.swing.JLabel(); - jTextField13 = new javax.swing.JTextField(); - jTextField1 = new javax.swing.JTextField(); - jLabel14 = new javax.swing.JLabel(); - jTextField10 = new javax.swing.JTextField(); - jTextField16 = new javax.swing.JTextField(); + jLabel17 = new javax.swing.JLabel(); + jLabel18 = new javax.swing.JLabel(); + jLabel22 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + jTextField3 = new javax.swing.JTextField(); jTextField6 = new javax.swing.JTextField(); - jTextField8 = new javax.swing.JTextField(); - jLabel4 = new javax.swing.JLabel(); - jLabel9 = new javax.swing.JLabel(); - jLabel10 = new javax.swing.JLabel(); - jLabel7 = new javax.swing.JLabel(); + jLabel21 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + jLabel25 = new javax.swing.JLabel(); + jLabel23 = new javax.swing.JLabel(); jTextField9 = new javax.swing.JTextField(); - jTextField2 = new javax.swing.JTextField(); + jTextField10 = new javax.swing.JTextField(); jTextField14 = new javax.swing.JTextField(); - jLabel8 = new javax.swing.JLabel(); - jLabel12 = new javax.swing.JLabel(); - jTextField7 = new javax.swing.JTextField(); - jLabel11 = new javax.swing.JLabel(); - jLabel6 = new javax.swing.JLabel(); - jLabel15 = new javax.swing.JLabel(); + jTextField11 = new javax.swing.JTextField(); + jLabel26 = new javax.swing.JLabel(); + jLabel29 = new javax.swing.JLabel(); + jTextField13 = new javax.swing.JTextField(); + jLabel28 = new javax.swing.JLabel(); + jTextField12 = new javax.swing.JTextField(); + jTextField8 = new javax.swing.JTextField(); + jLabel24 = new javax.swing.JLabel(); + jLabel27 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + jTextField15 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + jButton4 = new javax.swing.JButton(); + + jLabel15.setText("jLabel15"); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(new java.awt.Color(0, 204, 204)); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51, 51, 255)), "Return Panel", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(255, 0, 0))); // NOI18N + jPanel3.setBackground(new java.awt.Color(51, 51, 51)); + jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Return Panel", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(0, 204, 204))); // NOI18N - jLabel13.setText("Pages"); + jButton2.setBackground(new java.awt.Color(0, 153, 153)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N + jButton2.setText("Back"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); - jLabel1.setText("Student ID"); + jPanel2.setBackground(new java.awt.Color(51, 51, 51)); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Student_Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 18), new java.awt.Color(51, 255, 255))); // NOI18N + jPanel2.setToolTipText(""); - jLabel3.setText("Father Name"); + jTextField7.setEditable(false); + jTextField7.setBackground(new java.awt.Color(0, 204, 204)); - jLabel5.setText("Branch"); + jTextField4.setEditable(false); + jTextField4.setBackground(new java.awt.Color(0, 204, 204)); + jLabel20.setForeground(new java.awt.Color(255, 255, 255)); + jLabel20.setText("Branch"); + + jTextField2.setEditable(false); + jTextField2.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField5.setEditable(false); + jTextField5.setBackground(new java.awt.Color(0, 204, 204)); jTextField5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField5ActionPerformed(evt); } }); - jLabel2.setText("Name"); + jLabel17.setForeground(new java.awt.Color(255, 255, 255)); + jLabel17.setText("Name"); + + jLabel18.setForeground(new java.awt.Color(255, 255, 255)); + jLabel18.setText("Father_Name"); + + jLabel22.setForeground(new java.awt.Color(255, 255, 255)); + jLabel22.setText("Semester"); + + jLabel19.setForeground(new java.awt.Color(255, 255, 255)); + jLabel19.setText("Course"); + + jTextField3.setEditable(false); + jTextField3.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField6.setEditable(false); + jTextField6.setBackground(new java.awt.Color(0, 204, 204)); + jTextField6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField6ActionPerformed(evt); + } + }); + + jLabel21.setForeground(new java.awt.Color(255, 255, 255)); + jLabel21.setText("Year"); + + jLabel16.setForeground(new java.awt.Color(255, 255, 255)); + jLabel16.setText("Student_id"); + + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel16) + .addComponent(jLabel17) + .addComponent(jLabel18) + .addComponent(jLabel19) + .addComponent(jLabel20) + .addComponent(jLabel21) + .addComponent(jLabel22)) + .addGap(89, 89, 89) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jTextField1) + .addComponent(jTextField2) + .addComponent(jTextField3) + .addComponent(jTextField4) + .addComponent(jTextField5) + .addComponent(jTextField6) + .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel16) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel17) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel18) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel20) + .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel21) + .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel22) + .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Book_Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 18), new java.awt.Color(102, 255, 255))); // NOI18N + + jLabel25.setForeground(new java.awt.Color(255, 255, 255)); + jLabel25.setText("Publisher"); + + jLabel23.setForeground(new java.awt.Color(255, 255, 255)); + jLabel23.setText("Name_"); + + jTextField9.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField10.setBackground(new java.awt.Color(0, 204, 204)); + jTextField10.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField10ActionPerformed(evt); + } + }); + + jTextField14.setBackground(new java.awt.Color(0, 204, 204)); - jLabel14.setText("Date of Issue"); + jTextField11.setBackground(new java.awt.Color(0, 204, 204)); + jTextField11.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField11ActionPerformed(evt); + } + }); + + jLabel26.setForeground(new java.awt.Color(255, 255, 255)); + jLabel26.setText("Price"); - jLabel4.setText("Course"); + jLabel29.setForeground(new java.awt.Color(255, 255, 255)); + jLabel29.setText("Book_id"); - jLabel9.setText("Name"); + jTextField13.setBackground(new java.awt.Color(0, 204, 204)); - jLabel10.setText("Edition"); + jLabel28.setForeground(new java.awt.Color(255, 255, 255)); + jLabel28.setText("Date_of_Issue"); - jLabel7.setText("Semester"); + jTextField12.setBackground(new java.awt.Color(0, 204, 204)); - jLabel8.setText("Book Id"); + jTextField8.setBackground(new java.awt.Color(0, 204, 204)); - jLabel12.setText("Price"); + jLabel24.setForeground(new java.awt.Color(255, 255, 255)); + jLabel24.setText("Edition"); - jLabel11.setText("Publisher"); + jLabel27.setForeground(new java.awt.Color(255, 255, 255)); + jLabel27.setText("Pages"); - jLabel6.setText("Year"); + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Date_of_Return"); + + jTextField15.setBackground(new java.awt.Color(0, 204, 204)); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -102,181 +265,257 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1) - .addGap(30, 30, 30)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel2) - .addGap(53, 53, 53))) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jTextField1) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3) - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextField4) - .addComponent(jTextField3) - .addComponent(jTextField5) - .addComponent(jTextField6) - .addComponent(jTextField7))) - .addComponent(jLabel7) - .addComponent(jLabel6) - .addComponent(jLabel4) - .addComponent(jLabel5)) - .addGap(116, 116, 116) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel8) - .addComponent(jLabel9)) - .addComponent(jLabel11) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel10) - .addGap(8, 8, 8)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel12) - .addComponent(jLabel13))) - .addGap(41, 41, 41) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jTextField9) - .addComponent(jTextField8) - .addComponent(jTextField14) - .addComponent(jTextField13) - .addComponent(jTextField10) - .addComponent(jTextField15) - .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 309, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel14) - .addGap(195, 195, 195))) - .addContainerGap()) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jLabel29) + .addComponent(jLabel23) + .addComponent(jLabel24) + .addComponent(jLabel25) + .addComponent(jLabel26) + .addComponent(jLabel27) + .addComponent(jLabel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(89, 89, 89) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jTextField13) + .addComponent(jTextField14) + .addComponent(jTextField8) + .addComponent(jTextField9) + .addComponent(jTextField10) + .addComponent(jTextField11) + .addComponent(jTextField12, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE) + .addComponent(jTextField15)) + .addContainerGap(79, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(13, 13, 13) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel8))) - .addGap(5, 5, 5) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel9) - .addGap(8, 8, 8) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel29) + .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel23) + .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel10) - .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(26, 26, 26) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel4) - .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel11) - .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addComponent(jLabel12)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jLabel24) + .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(34, 34, 34) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel13)))) - .addGap(9, 9, 9) + .addComponent(jLabel25) + .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel14) - .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(9, 9, 9) + .addComponent(jLabel26) + .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel7) - .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap()) + .addComponent(jLabel27) + .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel28) + .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(38, Short.MAX_VALUE)) ); - jLabel15.setText("Return date"); - - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\issuecon.png")); // NOI18N + jButton1.setBackground(new java.awt.Color(0, 153, 153)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\issuecon.png")); // NOI18N jButton1.setText("Return"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\back.png")); // NOI18N - jButton2.setText("Back"); + jButton3.setBackground(new java.awt.Color(0, 153, 153)); + jButton3.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\search.png")); // NOI18N + jButton3.setText("Search"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + jButton4.setBackground(new java.awt.Color(0, 153, 153)); + jButton4.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\search.png")); // NOI18N + jButton4.setText("Search"); + jButton4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton4ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton4) + .addContainerGap()) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2) + .addGap(150, 150, 150)))) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton3))) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton4)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addGap(46, 46, 46)) + ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(15, 15, 15) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGap(122, 122, 122)) - .addGroup(layout.createSequentialGroup() - .addGap(302, 302, 302) - .addComponent(jLabel15) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton1) - .addGap(68, 68, 68) - .addComponent(jButton2) - .addGap(174, 174, 174)) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) ); 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.UNRELATED) - .addComponent(jLabel15) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton1) - .addComponent(jButton2)) - .addGap(0, 15, Short.MAX_VALUE)) + .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); - setSize(new java.awt.Dimension(746, 454)); - setLocationRelativeTo(null); + pack(); }// //GEN-END:initComponents private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField5ActionPerformed + private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField6ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField6ActionPerformed + + private void jTextField10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField10ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField10ActionPerformed + + private void jTextField11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField11ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField11ActionPerformed + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + setVisible(false); + Home ob=new Home(); + ob.setVisible(true); + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + + try { + String sql = "INSERT INTO ReturnBook(Student_id,Name_, Father_Name, Course, Branch, Year,Semester,Book_id,Name,Edition,Publisher,Price,Pages,Date_of_Issued,Date_of_Returned) VALUES(?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?,?)"; + + pst = conn.prepareStatement(sql); + pst.setString(1, jTextField1.getText()); + pst.setString(2, jTextField2.getText()); + pst.setString(3, jTextField3.getText()); + pst.setString(4, jTextField4.getText()); + pst.setString(5, jTextField5.getText()); + pst.setString(6, jTextField6.getText()); + pst.setString(7, jTextField7.getText()); + pst.setString(8, jTextField13.getText()); + pst.setString(9, jTextField14.getText()); + pst.setString(10, jTextField8.getText()); + pst.setString(11, jTextField9.getText()); + pst.setString(12, jTextField10.getText()); + pst.setString(13, jTextField11.getText()); + pst.setString(14, jTextField12.getText()); + pst.setString(15, jTextField15.getText()); + pst.execute(); + JOptionPane.showMessageDialog(null, "Book has been Returned Successfully!"); + rs.close(); + pst.close(); +} catch (SQLException e) { + JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); +} finally { + try { + if (pst != null) { + pst.close(); + } + } catch (SQLException e) { + // Handle the exception if closing the prepared statement fails + } +} + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + String a1 = jTextField1.getText(); + String sql = "select * from NewStudent where Student_id=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField2.setText(rs.getString("Name")); + jTextField3.setText(rs.getString("Father_Name")); + jTextField4.setText(rs.getString("Course")); + jTextField5.setText(rs.getString("Branch")); + jTextField6.setText(rs.getString("Year")); + jTextField7.setText(rs.getString("Semester")); + rs.close(); + pst.close(); + } else { + JOptionPane.showMessageDialog(null, "Incorrect Student ID"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } + }//GEN-LAST:event_jButton3ActionPerformed + + private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed + + + String a1 = jTextField13.getText(); + String sql = "select * from NewBook where Book_id=?"; + try { + pst = conn.prepareStatement(sql); + pst.setString(1, a1); + rs = pst.executeQuery(); + if (rs.next()) { + jTextField14.setText(rs.getString("Name")); + jTextField8.setText(rs.getString("Edition")); + jTextField9.setText(rs.getString("Publisher")); + jTextField10.setText(rs.getString("Price")); + jTextField11.setText(rs.getString("Pages")); + rs.close(); + pst.close(); + } else { + JOptionPane.showMessageDialog(null, "Incorrect ID"); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } + }//GEN-LAST:event_jButton4ActionPerformed + /** * @param args the command line arguments */ @@ -315,28 +554,34 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; + private javax.swing.JButton jButton3; + private javax.swing.JButton jButton4; private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel10; - private javax.swing.JLabel jLabel11; - private javax.swing.JLabel jLabel12; - private javax.swing.JLabel jLabel13; - private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JLabel jLabel8; - private javax.swing.JLabel jLabel9; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel21; + private javax.swing.JLabel jLabel22; + private javax.swing.JLabel jLabel23; + private javax.swing.JLabel jLabel24; + private javax.swing.JLabel jLabel25; + private javax.swing.JLabel jLabel26; + private javax.swing.JLabel jLabel27; + private javax.swing.JLabel jLabel28; + private javax.swing.JLabel jLabel29; private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField10; + private javax.swing.JTextField jTextField11; + private javax.swing.JTextField jTextField12; private javax.swing.JTextField jTextField13; private javax.swing.JTextField jTextField14; private javax.swing.JTextField jTextField15; - private javax.swing.JTextField jTextField16; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; diff --git a/src/Signup.form b/src/Signup.form index 4faad4e..e18f40e 100644 --- a/src/Signup.form +++ b/src/Signup.form @@ -1,26 +1,11 @@
- - - - - - - - - - - - - - - - + @@ -39,35 +24,28 @@ + - - - - - - - + - + + + + - - - - - - - - + + + @@ -79,39 +57,28 @@ - - + + - + - + - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + @@ -123,30 +90,30 @@ - - + + - + - + - + - + - - + + - + - - + + - + @@ -157,81 +124,116 @@ - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + - - - + - - + + - - + - + - + + + - + - - - - - - - - + + + - - - - - - - + + + + + + + + + + + - + - - + + - - + diff --git a/src/Signup.java b/src/Signup.java index 8bc71d8..5f21a13 100644 --- a/src/Signup.java +++ b/src/Signup.java @@ -20,7 +20,7 @@ public class Signup extends javax.swing.JFrame { * Creates new form Signup */ public Signup() { - super("Login"); + super("Signup"); initComponents(); conn = JavaConnect.ConnerDb(); @@ -32,7 +32,7 @@ public Signup() { * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") - // + // //GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); @@ -48,18 +48,20 @@ private void initComponents() { jTextField1 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); - jPanel3 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel2.setBackground(new java.awt.Color(51, 51, 51)); - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Signup", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Signup", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(0, 153, 204))); // NOI18N + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("Security Question"); + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Password"); jButton1.setBackground(new java.awt.Color(0, 204, 204)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\create.png")); // NOI18N jButton1.setText("Create"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -75,6 +77,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); jButton2.setBackground(new java.awt.Color(0, 204, 204)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N jButton2.setText("Back"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -82,6 +85,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Name"); jTextField3.setBackground(new java.awt.Color(0, 204, 204)); @@ -93,10 +97,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField4.setBackground(new java.awt.Color(0, 204, 204)); + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("Answer"); jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("Username"); jTextField2.setBackground(new java.awt.Color(0, 204, 204)); @@ -128,7 +134,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(jLabel5)) .addGap(26, 26, 26) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jTextField5, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE) + .addComponent(jTextField5, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE) .addComponent(jTextField3) .addComponent(jTextField2) .addComponent(jTextField4) @@ -157,48 +163,30 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addContainerGap()) ); - jPanel3.setBackground(new java.awt.Color(0, 204, 204)); - - javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); - jPanel3.setLayout(jPanel3Layout); - jPanel3Layout.setHorizontalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 235, Short.MAX_VALUE) - ); - jPanel3Layout.setVerticalGroup( - jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 0, Short.MAX_VALUE) - ); - 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(jPanel2, 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(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap()) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); - }// + }// //GEN-END:initComponents - private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try { String sql = "INSERT INTO Information(Username, Name, Password, `Security Question`, Answer) VALUES(?, ?, ?, ?, ?)"; pst = conn.prepareStatement(sql); @@ -224,27 +212,27 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { } - } + }//GEN-LAST:event_jButton1ActionPerformed - private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed setVisible(false); Login ob=new Login(); ob.setVisible(true); - } + }//GEN-LAST:event_jButton2ActionPerformed - private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) { + private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed // TODO add your handling code here: - } + }//GEN-LAST:event_jTextField2ActionPerformed - private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) { + private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed // TODO add your handling code here: - } + }//GEN-LAST:event_jTextField3ActionPerformed - private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) { + private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed // TODO add your handling code here: - } + }//GEN-LAST:event_jTextField5ActionPerformed /** * @param args the command line arguments @@ -281,7 +269,7 @@ public void run() { }); } - // Variables declaration - do not modify + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel2; @@ -290,11 +278,10 @@ public void run() { private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JPanel jPanel2; - private javax.swing.JPanel jPanel3; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; - // End of variables declaration + // End of variables declaration//GEN-END:variables } diff --git a/src/Statistics.form b/src/Statistics.form index 48db5f6..10078d1 100644 --- a/src/Statistics.form +++ b/src/Statistics.form @@ -1,14 +1,12 @@ - + - - - - + + @@ -25,80 +23,76 @@ - + - - - - - - - - - - + - - - - - - - + - - - - - - - - - - - - + + - - - + + + + + + + + + + - - - + + + + + + + + + + + + + + - + - + + + + @@ -111,55 +105,18 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + +
@@ -168,10 +125,51 @@
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> </Properties> </Component> </SubComponents> </Container> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\pc\Desktop\javac\Library_System\icon_login\back.png"/> + </Property> + <Property name="text" type="java.lang.String" value="back"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> </SubComponents> </Container> </SubComponents> diff --git a/src/Statistics.java b/src/Statistics.java index fecd4c2..68afe69 100644 --- a/src/Statistics.java +++ b/src/Statistics.java @@ -1,3 +1,11 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import javax.swing.JOptionPane; +import net.proteanit.sql.DbUtils; + /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template @@ -8,12 +16,44 @@ * @author pc */ public class Statistics extends javax.swing.JFrame { - +Connection conn; +ResultSet rs; +PreparedStatement pst; /** * Creates new form Statistics */ public Statistics() { + super("Statistics"); initComponents(); + conn = JavaConnect.ConnerDb(); + jTable3(); + jTable4(); + } + public void jTable3(){ + + String sql = "select Book_id,Name,Edition,Publisher,Price,Pages from NewBook "; + try { + pst = conn.prepareStatement(sql); + + rs = pst.executeQuery(); + jTable3.setModel(DbUtils.resultSetToTableModel(rs)); + + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } + } + public void jTable4(){ + + String sql = "select Student_id,Name,Father_Name,Course,Branch,Year,Semester from NewStudent "; + try { + pst = conn.prepareStatement(sql); + + rs = pst.executeQuery(); + jTable4.setModel(DbUtils.resultSetToTableModel(rs)); + + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, e); + } } /** @@ -26,17 +66,18 @@ public Statistics() { private void initComponents() { jPanel1 = new javax.swing.JPanel(); - jScrollPane1 = new javax.swing.JScrollPane(); - jTable1 = new javax.swing.JTable(); - jPanel2 = new javax.swing.JPanel(); - jScrollPane2 = new javax.swing.JScrollPane(); - jTable2 = new javax.swing.JTable(); + jScrollPane4 = new javax.swing.JScrollPane(); + jTable4 = new javax.swing.JTable(); + jScrollPane3 = new javax.swing.JScrollPane(); + jTable3 = new javax.swing.JTable(); + jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 255)), "Issue Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(255, 102, 0))); // NOI18N + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); - jTable1.setModel(new javax.swing.table.DefaultTableModel( + jTable4.setBackground(new java.awt.Color(0, 204, 204)); + jTable4.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, @@ -47,27 +88,10 @@ private void initComponents() { "Title 1", "Title 2", "Title 3", "Title 4" } )); - jScrollPane1.setViewportView(jTable1); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) - ); - - jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(51, 255, 0)), "Return Detail", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 24), new java.awt.Color(51, 51, 255))); // NOI18N + jScrollPane4.setViewportView(jTable4); - jTable2.setModel(new javax.swing.table.DefaultTableModel( + jTable3.setBackground(new java.awt.Color(0, 204, 204)); + jTable3.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, @@ -78,22 +102,43 @@ private void initComponents() { "Title 1", "Title 2", "Title 3", "Title 4" } )); - jScrollPane2.setViewportView(jTable2); + jScrollPane3.setViewportView(jTable3); + + jButton1.setBackground(new java.awt.Color(0, 153, 153)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N + jButton1.setText("back"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); - javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); - jPanel2.setLayout(jPanel2Layout); - jPanel2Layout.setHorizontalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap()) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 452, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(36, Short.MAX_VALUE)) ); - jPanel2Layout.setVerticalGroup( - jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButton1)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 115, Short.MAX_VALUE) + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); @@ -103,28 +148,22 @@ private void initComponents() { layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addGroup(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) - .addGap(492, 492, 492)) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(42, 42, 42)) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); - setSize(new java.awt.Dimension(695, 396)); - setLocationRelativeTo(null); + pack(); }// </editor-fold>//GEN-END:initComponents + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + setVisible(false); + Home ob=new Home(); + ob.setVisible(true); + }//GEN-LAST:event_jButton1ActionPerformed + /** * @param args the command line arguments */ @@ -161,11 +200,11 @@ public void run() { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; - private javax.swing.JPanel jPanel2; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JScrollPane jScrollPane2; - private javax.swing.JTable jTable1; - private javax.swing.JTable jTable2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JScrollPane jScrollPane4; + private javax.swing.JTable jTable3; + private javax.swing.JTable jTable4; // End of variables declaration//GEN-END:variables } diff --git a/src/Student.form b/src/Student.form deleted file mode 100644 index 0944394..0000000 --- a/src/Student.form +++ /dev/null @@ -1,293 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="3"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,108,0,0,2,25"/> - <SyntheticProperty name="formSizePolicy" type="int" value="0"/> - <SyntheticProperty name="generateSize" type="boolean" value="true"/> - <SyntheticProperty name="generateCenter" type="boolean" value="true"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="153" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="16" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> - <Properties> - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> - <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> - <TitledBorder title="NewStudent"> - <Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> - <LineBorder> - <Color PropertyName="color" blue="99" green="99" red="ff" type="rgb"/> - </LineBorder> - </Border> - <Font PropertyName="font" name="Tahoma" size="18" style="0"/> - <Color PropertyName="color" blue="0" green="cc" red="ff" type="rgb"/> - </TitledBorder> - </Border> - </Property> - </Properties> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="75" max="-2" attributes="0"/> - <Component id="jButton1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="61" max="-2" attributes="0"/> - <Component id="jButton2" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="111" max="-2" attributes="0"/> - <Component id="jTextField1" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="118" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="jComboBox1" max="32767" attributes="0"/> - <Component id="jTextField4" max="32767" attributes="0"/> - <Component id="jComboBox3" max="32767" attributes="0"/> - <Component id="jComboBox4" min="-2" pref="162" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="98" max="-2" attributes="0"/> - <Component id="jTextField3" min="-2" pref="162" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> - <Component id="jTextField2" min="-2" pref="162" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField4" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jComboBox3" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> - <Component id="jLabel7" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jComboBox4" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="jLabel4"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Course"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="jTextField2"> - </Component> - <Component class="javax.swing.JTextField" name="jTextField3"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel7"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Semester"/> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="jComboBox1"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="5"> - <StringItem index="0" value="Programming in python"/> - <StringItem index="1" value="programming in java"/> - <StringItem index="2" value="probability and statistics"/> - <StringItem index="3" value="Computer architecture"/> - <StringItem index="4" value=" "/> - </StringArray> - </Property> - </Properties> - <AuxValues> - <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> - </AuxValues> - </Component> - <Component class="javax.swing.JLabel" name="jLabel6"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Year"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="jTextField1"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Father Name"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton1"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="2" name="C:\Users\pc\Desktop\javac\Library_Management_System\icon_login\create.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Register"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton2"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="2" name="C:\Users\pc\Desktop\javac\Library_Management_System\icon_login\back.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Back"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel1"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Student ID"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="jTextField4"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel5"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Branch"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="jLabel2"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Tahoma" size="14" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Name"/> - </Properties> - </Component> - <Component class="javax.swing.JComboBox" name="jComboBox3"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="3"> - <StringItem index="0" value="2021"/> - <StringItem index="1" value="2022"/> - <StringItem index="2" value="2023"/> - </StringArray> - </Property> - </Properties> - <AuxValues> - <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> - </AuxValues> - </Component> - <Component class="javax.swing.JComboBox" name="jComboBox4"> - <Properties> - <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> - <StringArray count="3"> - <StringItem index="0" value="Fall"/> - <StringItem index="1" value="Spring"/> - <StringItem index="2" value="Summer"/> - </StringArray> - </Property> - </Properties> - <AuxValues> - <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> - </AuxValues> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/src/Student.java b/src/Student.java deleted file mode 100644 index 4f3bb66..0000000 --- a/src/Student.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template - */ - -/** - * - * @author pc - */ -public class Student extends javax.swing.JFrame { - - /** - * Creates new form Student - */ - public Student() { - 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() { - - jPanel1 = new javax.swing.JPanel(); - jLabel4 = new javax.swing.JLabel(); - jTextField2 = new javax.swing.JTextField(); - jTextField3 = new javax.swing.JTextField(); - jLabel7 = new javax.swing.JLabel(); - jComboBox1 = new javax.swing.JComboBox<>(); - jLabel6 = new javax.swing.JLabel(); - jTextField1 = new javax.swing.JTextField(); - jLabel3 = new javax.swing.JLabel(); - jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); - jLabel1 = new javax.swing.JLabel(); - jTextField4 = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - jLabel2 = new javax.swing.JLabel(); - jComboBox3 = new javax.swing.JComboBox<>(); - jComboBox4 = new javax.swing.JComboBox<>(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - - jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 153, 153)), "NewStudent", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(255, 204, 0))); // NOI18N - - jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel4.setText("Course"); - - jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel7.setText("Semester"); - - jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Programming in python", "programming in java", "probability and statistics", "Computer architecture", " " })); - - jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel6.setText("Year"); - - jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel3.setText("Father Name"); - - jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\create.png")); // NOI18N - jButton1.setText("Register"); - - jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_Management_System\\icon_login\\back.png")); // NOI18N - jButton2.setText("Back"); - - jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel1.setText("Student ID"); - - jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel5.setText("Branch"); - - jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N - jLabel2.setText("Name"); - - jComboBox3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "2021", "2022", "2023" })); - - jComboBox4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Fall", "Spring", "Summer" })); - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(75, 75, 75) - .addComponent(jButton1) - .addGap(61, 61, 61) - .addComponent(jButton2)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1) - .addGap(111, 111, 111) - .addComponent(jTextField1)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel4) - .addComponent(jLabel5) - .addComponent(jLabel6) - .addComponent(jLabel7)) - .addGap(118, 118, 118) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jTextField4) - .addComponent(jComboBox3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel3) - .addGap(98, 98, 98) - .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel2) - .addGap(143, 143, 143) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap()) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel1) - .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel2) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(8, 8, 8) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel3) - .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel4) - .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel6) - .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(24, 24, 24) - .addComponent(jLabel7)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(27, 27, 27) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton1) - .addComponent(jButton2)) - .addContainerGap()) - ); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(153, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(14, 14, 14) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(16, Short.MAX_VALUE)) - ); - - setSize(new java.awt.Dimension(537, 364)); - setLocationRelativeTo(null); - }// </editor-fold>//GEN-END:initComponents - - /** - * @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(Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(Student.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 Student().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton jButton1; - private javax.swing.JButton jButton2; - private javax.swing.JComboBox<String> jComboBox1; - private javax.swing.JComboBox<String> jComboBox3; - private javax.swing.JComboBox<String> jComboBox4; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JLabel jLabel6; - private javax.swing.JLabel jLabel7; - private javax.swing.JPanel jPanel1; - private javax.swing.JTextField jTextField1; - private javax.swing.JTextField jTextField2; - private javax.swing.JTextField jTextField3; - private javax.swing.JTextField jTextField4; - // End of variables declaration//GEN-END:variables -} diff --git a/src/Students.form b/src/Students.form new file mode 100644 index 0000000..c75eaee --- /dev/null +++ b/src/Students.form @@ -0,0 +1,374 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="1" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="33" green="33" red="33" type="rgb"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> + <TitledBorder title="NewStudent"> + <Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder roundedCorners="true"/> + </Border> + <Font PropertyName="font" name="Tahoma" size="18" style="0"/> + <Color PropertyName="color" blue="0" green="0" red="0" type="rgb"/> + </TitledBorder> + </Border> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="75" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="61" max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="111" max="-2" attributes="0"/> + <Component id="jTextField1" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="98" max="-2" attributes="0"/> + <Component id="jTextField3" min="-2" pref="162" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" pref="162" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="248" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="123" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="jComboBox1" max="32767" attributes="0"/> + <Component id="jComboBox2" max="32767" attributes="0"/> + <Component id="jComboBox3" alignment="0" min="-2" pref="162" max="-2" attributes="0"/> + <Component id="jComboBox4" min="-2" pref="162" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jTextField3" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jComboBox4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="26" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Course"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Semester"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="5"> + <StringItem index="0" value="Programming in python"/> + <StringItem index="1" value="programming in java"/> + <StringItem index="2" value="probability and statistics"/> + <StringItem index="3" value="Computer architecture"/> + <StringItem index="4" value=" "/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Year"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Father_Name"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\pc\Desktop\javac\Library_System\icon_login\create.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Register"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="2" name="C:\Users\pc\Desktop\javac\Library_System\icon_login\back.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Back"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Student_id"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Branch"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Name"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="3"> + <StringItem index="0" value="2021"/> + <StringItem index="1" value="2022"/> + <StringItem index="2" value="2023"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox4"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="3"> + <StringItem index="0" value="Fall"/> + <StringItem index="1" value="Spring"/> + <StringItem index="2" value="Summer"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="jComboBox2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="0" type="rgb"/> + </Property> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="7"> + <StringItem index="0" value="SEN"/> + <StringItem index="1" value="ISN"/> + <StringItem index="2" value="CYBER"/> + <StringItem index="3" value="ICT"/> + <StringItem index="4" value="CS"/> + <StringItem index="5" value="BMS"/> + <StringItem index="6" value="RE"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/Students.java b/src/Students.java new file mode 100644 index 0000000..41296b8 --- /dev/null +++ b/src/Students.java @@ -0,0 +1,325 @@ + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Random; +import javax.swing.JOptionPane; + +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ + +/** + * + * @author pc + */ +public class Students extends javax.swing.JFrame { +Connection conn; +ResultSet rs; +PreparedStatement pst; + /** + * Creates new form Students + */ + public Students() { + super("New Student"); + initComponents(); + conn = JavaConnect.ConnerDb(); + Random(); + } + public void Random(){ + Random rd=new Random(); + jTextField1.setText(""+rd.nextInt(1000+1)); + } + + /** + * 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() { + + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + jLabel4 = new javax.swing.JLabel(); + jTextField2 = new javax.swing.JTextField(); + jTextField3 = new javax.swing.JTextField(); + jLabel7 = new javax.swing.JLabel(); + jComboBox1 = new javax.swing.JComboBox<>(); + jLabel6 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jComboBox3 = new javax.swing.JComboBox<>(); + jComboBox4 = new javax.swing.JComboBox<>(); + jComboBox2 = new javax.swing.JComboBox<>(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jPanel2.setBackground(new java.awt.Color(51, 51, 51)); + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "NewStudent", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 18), new java.awt.Color(0, 0, 0))); // NOI18N + + jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); + jLabel4.setText("Course"); + + jTextField2.setBackground(new java.awt.Color(0, 204, 204)); + + jTextField3.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel7.setForeground(new java.awt.Color(255, 255, 255)); + jLabel7.setText("Semester"); + + jComboBox1.setBackground(new java.awt.Color(0, 204, 204)); + jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Programming in python", "programming in java", "probability and statistics", "Computer architecture", " " })); + + jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); + jLabel6.setText("Year"); + + jTextField1.setBackground(new java.awt.Color(0, 204, 204)); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); + jLabel3.setText("Father_Name"); + + jButton1.setBackground(new java.awt.Color(0, 204, 204)); + jButton1.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\create.png")); // NOI18N + jButton1.setText("Register"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton2.setBackground(new java.awt.Color(0, 204, 204)); + jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Desktop\\javac\\Library_System\\icon_login\\back.png")); // NOI18N + jButton2.setText("Back"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("Student_id"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("Branch"); + + jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Name"); + + jComboBox3.setBackground(new java.awt.Color(0, 204, 204)); + jComboBox3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "2021", "2022", "2023" })); + + jComboBox4.setBackground(new java.awt.Color(0, 204, 204)); + jComboBox4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Fall", "Spring", "Summer" })); + + jComboBox2.setBackground(new java.awt.Color(0, 204, 204)); + jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SEN", "ISN", "CYBER", "ICT", "CS", "BMS", "RE" })); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(75, 75, 75) + .addComponent(jButton1) + .addGap(61, 61, 61) + .addComponent(jButton2)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(111, 111, 111) + .addComponent(jTextField1)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel3) + .addGap(98, 98, 98) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(143, 143, 143) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(248, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel4) + .addComponent(jLabel5) + .addComponent(jLabel6) + .addComponent(jLabel7)) + .addGap(123, 123, 123) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))))) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(8, 8, 8) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(22, 22, 22) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(24, 24, 24) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addContainerGap(26, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + 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 jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + setVisible(false); + Home ob=new Home(); + ob.setVisible(true); + }//GEN-LAST:event_jButton2ActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + try { + String sql = "INSERT INTO NewStudent(Student_id,Name,Father_Name,Course,Branch,Year,Semester) VALUES(?, ?, ?, ?, ?,?,?)"; + pst = conn.prepareStatement(sql); + pst.setString(1, jTextField1.getText()); + pst.setString(2, jTextField2.getText()); + pst.setString(3, jTextField3.getText()); + pst.setString(4, (String) jComboBox1.getSelectedItem()); + pst.setString(5, (String) jComboBox2.getSelectedItem()); + pst.setString(6, (String) jComboBox3.getSelectedItem()); + pst.setString(7, (String) jComboBox4.getSelectedItem()); + pst.execute(); + JOptionPane.showMessageDialog(null, "New Student Registered Successfully!"); + rs.close(); + pst.close(); +} catch (SQLException e) { + JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); +} finally { + try { + if (pst != null) { + pst.close(); + } + } catch (SQLException e) { + // Handle the exception if closing the prepared statement fails + } +} + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @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(Students.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(Students.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(Students.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Students.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 Students().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JComboBox<String> jComboBox1; + private javax.swing.JComboBox<String> jComboBox2; + private javax.swing.JComboBox<String> jComboBox3; + private javax.swing.JComboBox<String> jComboBox4; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; + // End of variables declaration//GEN-END:variables +} diff --git a/src/information.sqlite b/src/information.sqlite deleted file mode 100644 index 27dfe0a..0000000 Binary files a/src/information.sqlite and /dev/null differ