content: 
  import java.awt.Color;
  import java.sql.Connection;
  import java.sql.SQLException;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  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 ahmed
   */
  public class Update_Student extends javax.swing.JFrame {
  
      /**
       * Creates new form Update_Student
       */
      public Update_Student() {
          initComponents();
          this.setLocationRelativeTo(null);
          stdname.setVisible(false);
          stddepartment.setVisible(false);
          stdpassword.setVisible(false);
          stdcredithr.setVisible(false);
  
      }
  
      /**
       * 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();
          jLabel1 = new javax.swing.JLabel();
          stdname = new javax.swing.JPanel();
          std_name = new javax.swing.JTextField();
          jButton1 = new javax.swing.JButton();
          stdpassword = new javax.swing.JPanel();
          std_pass = new javax.swing.JTextField();
          jButton5 = new javax.swing.JButton();
          stdcredithr = new javax.swing.JPanel();
          std_cred = new javax.swing.JTextField();
          jButton6 = new javax.swing.JButton();
          stddepartment = new javax.swing.JPanel();
          std_dept = new javax.swing.JTextField();
          jButton7 = new javax.swing.JButton();
          jPanel7 = new javax.swing.JPanel();
          a1 = new javax.swing.JLabel();
          jPanel10 = new javax.swing.JPanel();
          a2 = new javax.swing.JLabel();
          jPanel9 = new javax.swing.JPanel();
          a4 = new javax.swing.JLabel();
          jPanel11 = new javax.swing.JPanel();
          a5 = new javax.swing.JLabel();
          std_id = new javax.swing.JTextField();
          jButton8 = new javax.swing.JButton();
          jLabel2 = new javax.swing.JLabel();
          jButton9 = new javax.swing.JButton();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          setPreferredSize(new java.awt.Dimension(700, 310));
          setResizable(false);
  
          jPanel1.setBackground(new java.awt.Color(0, 64, 128));
  
          stdname.setBackground(new java.awt.Color(173, 216, 230));
  
          std_name.setText("Enter new Student's name");
          std_name.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  std_nameActionPerformed(evt);
              }
          });
  
          jButton1.setBackground(new java.awt.Color(0, 64, 128));
          jButton1.setForeground(new java.awt.Color(255, 255, 255));
          jButton1.setText("Enter");
          jButton1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jButton1ActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout stdnameLayout = new javax.swing.GroupLayout(stdname);
          stdname.setLayout(stdnameLayout);
          stdnameLayout.setHorizontalGroup(
              stdnameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdnameLayout.createSequentialGroup()
                  .addGap(25, 25, 25)
                  .addGroup(stdnameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jButton1)
                      .addComponent(std_name, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(33, Short.MAX_VALUE))
          );
          stdnameLayout.setVerticalGroup(
              stdnameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdnameLayout.createSequentialGroup()
                  .addGap(45, 45, 45)
                  .addComponent(std_name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                  .addComponent(jButton1)
                  .addContainerGap(11, Short.MAX_VALUE))
          );
  
          stdpassword.setBackground(new java.awt.Color(173, 216, 230));
  
          std_pass.setText("New password");
  
          jButton5.setBackground(new java.awt.Color(0, 64, 128));
          jButton5.setForeground(new java.awt.Color(255, 255, 255));
          jButton5.setText("Enter");
          jButton5.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jButton5ActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout stdpasswordLayout = new javax.swing.GroupLayout(stdpassword);
          stdpassword.setLayout(stdpasswordLayout);
          stdpasswordLayout.setHorizontalGroup(
              stdpasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdpasswordLayout.createSequentialGroup()
                  .addGap(33, 33, 33)
                  .addGroup(stdpasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jButton5)
                      .addComponent(std_pass, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(25, Short.MAX_VALUE))
          );
          stdpasswordLayout.setVerticalGroup(
              stdpasswordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdpasswordLayout.createSequentialGroup()
                  .addGap(49, 49, 49)
                  .addComponent(std_pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(jButton5)
                  .addContainerGap(12, Short.MAX_VALUE))
          );
  
          stdcredithr.setBackground(new java.awt.Color(173, 216, 230));
  
          std_cred.setText("New credit hour");
  
          jButton6.setBackground(new java.awt.Color(0, 64, 128));
          jButton6.setForeground(new java.awt.Color(255, 255, 255));
          jButton6.setText("Enter");
          jButton6.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jButton6ActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout stdcredithrLayout = new javax.swing.GroupLayout(stdcredithr);
          stdcredithr.setLayout(stdcredithrLayout);
          stdcredithrLayout.setHorizontalGroup(
              stdcredithrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdcredithrLayout.createSequentialGroup()
                  .addGap(20, 20, 20)
                  .addGroup(stdcredithrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jButton6)
                      .addComponent(std_cred, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(38, Short.MAX_VALUE))
          );
          stdcredithrLayout.setVerticalGroup(
              stdcredithrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stdcredithrLayout.createSequentialGroup()
                  .addGap(49, 49, 49)
                  .addComponent(std_cred, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                  .addComponent(jButton6)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          stddepartment.setBackground(new java.awt.Color(173, 216, 230));
  
          std_dept.setText("New Department");
  
          jButton7.setBackground(new java.awt.Color(0, 64, 128));
          jButton7.setForeground(new java.awt.Color(255, 255, 255));
          jButton7.setText("Enter");
          jButton7.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jButton7ActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout stddepartmentLayout = new javax.swing.GroupLayout(stddepartment);
          stddepartment.setLayout(stddepartmentLayout);
          stddepartmentLayout.setHorizontalGroup(
              stddepartmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stddepartmentLayout.createSequentialGroup()
                  .addGap(19, 19, 19)
                  .addGroup(stddepartmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jButton7)
                      .addComponent(std_dept, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(39, Short.MAX_VALUE))
          );
          stddepartmentLayout.setVerticalGroup(
              stddepartmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(stddepartmentLayout.createSequentialGroup()
                  .addGap(47, 47, 47)
                  .addComponent(std_dept, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(jButton7)
                  .addContainerGap(14, Short.MAX_VALUE))
          );
  
          jPanel7.setBackground(new java.awt.Color(10, 50, 100));
          jPanel7.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  jPanel7MouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  jPanel7MouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jPanel7MousePressed(evt);
              }
          });
  
          a1.setForeground(new java.awt.Color(255, 255, 255));
          a1.setText("Update Student name");
  
          javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
          jPanel7.setLayout(jPanel7Layout);
          jPanel7Layout.setHorizontalGroup(
              jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel7Layout.createSequentialGroup()
                  .addGap(23, 23, 23)
                  .addComponent(a1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
          jPanel7Layout.setVerticalGroup(
              jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel7Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a1)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          jPanel10.setBackground(new java.awt.Color(10, 50, 100));
          jPanel10.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  jPanel10MouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  jPanel10MouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jPanel10MousePressed(evt);
              }
          });
  
          a2.setForeground(new java.awt.Color(255, 255, 255));
          a2.setText("Update Student's Password");
  
          javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
          jPanel10.setLayout(jPanel10Layout);
          jPanel10Layout.setHorizontalGroup(
              jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel10Layout.createSequentialGroup()
                  .addGap(15, 15, 15)
                  .addComponent(a2, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(17, Short.MAX_VALUE))
          );
          jPanel10Layout.setVerticalGroup(
              jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a2, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                  .addContainerGap())
          );
  
          jPanel9.setBackground(new java.awt.Color(10, 50, 100));
          jPanel9.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  jPanel9MouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  jPanel9MouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jPanel9MousePressed(evt);
              }
          });
  
          a4.setBackground(new java.awt.Color(255, 255, 255));
          a4.setForeground(new java.awt.Color(255, 255, 255));
          a4.setText("Update Student's Credit hr");
  
          javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
          jPanel9.setLayout(jPanel9Layout);
          jPanel9Layout.setHorizontalGroup(
              jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                  .addContainerGap(12, Short.MAX_VALUE)
                  .addComponent(a4, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap())
          );
          jPanel9Layout.setVerticalGroup(
              jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel9Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a4)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          jPanel11.setBackground(new java.awt.Color(10, 50, 100));
          jPanel11.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  jPanel11MouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  jPanel11MouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jPanel11MousePressed(evt);
              }
          });
  
          a5.setForeground(new java.awt.Color(255, 255, 255));
          a5.setText("Update Student's Department");
  
          javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
          jPanel11.setLayout(jPanel11Layout);
          jPanel11Layout.setHorizontalGroup(
              jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel11Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a5)
                  .addContainerGap(20, Short.MAX_VALUE))
          );
          jPanel11Layout.setVerticalGroup(
              jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel11Layout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a5)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          std_id.setText("Enter Student's ID");
  
          jButton8.setBackground(new java.awt.Color(0, 64, 128));
          jButton8.setForeground(new java.awt.Color(255, 255, 255));
          jButton8.setText("Enter");
  
          jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\ahmed\\OneDrive\\Desktop\\download-removebg-preview (1) - Copy.png")); // NOI18N
  
          jButton9.setBackground(new java.awt.Color(0, 64, 128));
          jButton9.setForeground(new java.awt.Color(255, 255, 255));
          jButton9.setText("back");
          jButton9.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jButton9MousePressed(evt);
              }
          });
  
          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()
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addComponent(std_id, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                          .addComponent(jButton8)
                          .addGap(30, 30, 30)
                          .addComponent(jButton9))
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addComponent(stdname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(stdpassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(stdcredithr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(stddepartment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(46, 46, 46)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                              .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                              .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                          .addGap(0, 0, Short.MAX_VALUE))
                      .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                      .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGap(87, 87, 87)
                  .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(625, 625, 625)
                  .addComponent(jLabel1)
                  .addContainerGap())
          );
          jPanel1Layout.setVerticalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addContainerGap()
                          .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addGap(15, 15, 15)
                          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                              .addComponent(jLabel2)
                              .addGroup(jPanel1Layout.createSequentialGroup()
                                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                      .addComponent(std_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                      .addComponent(jButton8)
                                      .addComponent(jButton9))
                                  .addGap(18, 18, 18)
                                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                      .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                          .addComponent(stdname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addComponent(stdpassword, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addComponent(stdcredithr, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                      .addGroup(jPanel1Layout.createSequentialGroup()
                                          .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                          .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                          .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                          .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                      .addComponent(stddepartment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                  .addContainerGap(122, 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.PREFERRED_SIZE, 1634, 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)
          );
  
          pack();
      }// </editor-fold>//GEN-END:initComponents
  
      private void std_nameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_std_nameActionPerformed
          // TODO add your handling code here:
      }//GEN-LAST:event_std_nameActionPerformed
  
      private void jPanel7MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MouseEntered
          // TODO add your handling code here:
          a1.setForeground(new java.awt.Color(173, 216, 230));
  
      }//GEN-LAST:event_jPanel7MouseEntered
  
      private void jPanel7MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MouseExited
          // TODO add your handling code here:
          a1.setForeground(Color.WHITE);
  
      }//GEN-LAST:event_jPanel7MouseExited
  
      private void jPanel10MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel10MouseEntered
          // TODO add your handling code here:
          a2.setForeground(new java.awt.Color(173, 216, 230));
  
      }//GEN-LAST:event_jPanel10MouseEntered
  
      private void jPanel10MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel10MouseExited
          // TODO add your handling code here:
          a2.setForeground(Color.WHITE);
      }//GEN-LAST:event_jPanel10MouseExited
  
      private void jPanel9MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel9MouseEntered
          // TODO add your handling code here:
          a4.setForeground(new java.awt.Color(173, 216, 230));
  
      }//GEN-LAST:event_jPanel9MouseEntered
  
      private void jPanel9MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel9MouseExited
          // TODO add your handling code here:
          a4.setForeground(Color.WHITE);
      }//GEN-LAST:event_jPanel9MouseExited
  
      private void jPanel11MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel11MouseEntered
          // TODO add your handling code here:
          a5.setForeground(new java.awt.Color(173, 216, 230));
  
      }//GEN-LAST:event_jPanel11MouseEntered
  
      private void jPanel11MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel11MouseExited
          // TODO add your handling code here:
          a5.setForeground(Color.WHITE);
      }//GEN-LAST:event_jPanel11MouseExited
  
      private void jPanel7MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MousePressed
          // TODO add your handling code here:
          stdname.setVisible(true);
          stddepartment.setVisible(false);
          stdpassword.setVisible(false);
          stdcredithr.setVisible(false);
      }//GEN-LAST:event_jPanel7MousePressed
  
      private void jPanel10MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel10MousePressed
          // TODO add your handling code here:
          stdname.setVisible(false);
          stddepartment.setVisible(false);
          stdpassword.setVisible(true);
          stdcredithr.setVisible(false);
      }//GEN-LAST:event_jPanel10MousePressed
  
      private void jPanel11MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel11MousePressed
          // TODO add your handling code here:
          stdname.setVisible(false);
          stddepartment.setVisible(true);
          stdpassword.setVisible(false);
          stdcredithr.setVisible(false);
      }//GEN-LAST:event_jPanel11MousePressed
  
      private void jPanel9MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel9MousePressed
          // TODO add your handling code here:
          stdname.setVisible(false);
          stddepartment.setVisible(false);
          stdpassword.setVisible(false);
          stdcredithr.setVisible(true);
      }//GEN-LAST:event_jPanel9MousePressed
  
      private void jButton9MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton9MousePressed
          // TODO add your handling code here:
          if (Login.adminlogin) {
              systemManag s = new systemManag();
              s.setVisible(true);
              s.setLocationRelativeTo(null);//center
              this.dispose();
          } else {
              InstructorManag s = new InstructorManag();
              s.setVisible(true);
              s.setLocationRelativeTo(null);//center
              this.dispose();
          }
      }//GEN-LAST:event_jButton9MousePressed
  
      private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
          // TODO add your handling code here:
          String Name = std_name.getText();
          int Student_id = Integer.parseInt(std_id.getText());
  
  // Database operation
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Student SET Student_Name = ? WHERE Student_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setString(1, Name);
              preparedStatement.setInt(2, Student_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Student Name Update Successfully");
  
          } catch (SQLException e) {
              Logger.getLogger(SignUp.class.getName()).log(Level.SEVERE, "Database error: ", e);
              JOptionPane.showMessageDialog(this, "An error occurred while saving This data. Please try again.");
          }
      }//GEN-LAST:event_jButton1ActionPerformed
  
      private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
          // TODO add your handling code here:
          String password = std_pass.getText();
          int Student_id = Integer.parseInt(std_id.getText());
  
  // Database operation
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Student SET Student_Password = ? WHERE Student_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setString(1, password);
              preparedStatement.setInt(2, Student_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Student password Update Successfully");
  
          } catch (SQLException e) {
              Logger.getLogger(SignUp.class.getName()).log(Level.SEVERE, "Database error: ", e);
              JOptionPane.showMessageDialog(this, "An error occurred while saving This data. Please try again.");
          }
      }//GEN-LAST:event_jButton5ActionPerformed
  
      private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
          // TODO add your handling code here:
          int credits = Integer.parseInt(std_cred.getText());
          int Student_id = Integer.parseInt(std_id.getText());
  
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Student SET Total_cred = ? WHERE Student_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setInt(1, credits);
              preparedStatement.setInt(2, Student_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Student Credit hours Update Successfully");
  
          } catch (SQLException e) {
              Logger.getLogger(SignUp.class.getName()).log(Level.SEVERE, "Database error: ", e);
              JOptionPane.showMessageDialog(this, "An error occurred while saving This data. Please try again.");
          }
      }//GEN-LAST:event_jButton6ActionPerformed
  
      private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
          // TODO add your handling code here:
          int d_id = Integer.parseInt(std_dept.getText());
          int Student_id = Integer.parseInt(std_id.getText());
  
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Student SET Dept_ID = ? WHERE Student_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setInt(1, d_id);
              preparedStatement.setInt(2, Student_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Student Department hours Update Successfully");
  
          } catch (SQLException e) {
              Logger.getLogger(SignUp.class.getName()).log(Level.SEVERE, "Database error: ", e);
              JOptionPane.showMessageDialog(this, "An error occurred while saving This data. Please try again.");
          }
      }//GEN-LAST:event_jButton7ActionPerformed
  
      /**
       * @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(Update_Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (InstantiationException ex) {
              java.util.logging.Logger.getLogger(Update_Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (IllegalAccessException ex) {
              java.util.logging.Logger.getLogger(Update_Student.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (javax.swing.UnsupportedLookAndFeelException ex) {
              java.util.logging.Logger.getLogger(Update_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 Update_Student().setVisible(true);
              }
          });
      }
  
      // Variables declaration - do not modify//GEN-BEGIN:variables
      private javax.swing.JLabel a1;
      private javax.swing.JLabel a2;
      private javax.swing.JLabel a4;
      private javax.swing.JLabel a5;
      private javax.swing.JButton jButton1;
      private javax.swing.JButton jButton5;
      private javax.swing.JButton jButton6;
      private javax.swing.JButton jButton7;
      private javax.swing.JButton jButton8;
      private javax.swing.JButton jButton9;
      private javax.swing.JLabel jLabel1;
      private javax.swing.JLabel jLabel2;
      private javax.swing.JPanel jPanel1;
      private javax.swing.JPanel jPanel10;
      private javax.swing.JPanel jPanel11;
      private javax.swing.JPanel jPanel7;
      private javax.swing.JPanel jPanel9;
      private javax.swing.JTextField std_cred;
      private javax.swing.JTextField std_dept;
      private javax.swing.JTextField std_id;
      private javax.swing.JTextField std_name;
      private javax.swing.JTextField std_pass;
      private javax.swing.JPanel stdcredithr;
      private javax.swing.JPanel stddepartment;
      private javax.swing.JPanel stdname;
      private javax.swing.JPanel stdpassword;
      // End of variables declaration//GEN-END:variables
  }
  