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_Instructor extends javax.swing.JFrame {
  
      /**
       * Creates new form Update_Instructor
       */
      public Update_Instructor() {
          initComponents();
          this.setLocationRelativeTo(null);
          Inst_Name.setVisible(false);
          department.setVisible(false);
          password.setVisible(false);
          Salary.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();
          Inst_Name = new javax.swing.JPanel();
          inst_name = new javax.swing.JTextField();
          Name_Button = new javax.swing.JButton();
          password = new javax.swing.JPanel();
          pass = new javax.swing.JTextField();
          Password_Button = new javax.swing.JButton();
          department = new javax.swing.JPanel();
          dept = new javax.swing.JTextField();
          Department_Button = new javax.swing.JButton();
          Salary = new javax.swing.JPanel();
          salary = new javax.swing.JTextField();
          Salary_Button = new javax.swing.JButton();
          name_button = new javax.swing.JPanel();
          a1 = new javax.swing.JLabel();
          salary_button = new javax.swing.JPanel();
          a3 = new javax.swing.JLabel();
          password_button = new javax.swing.JPanel();
          a7 = new javax.swing.JLabel();
          department_button = new javax.swing.JPanel();
          a5 = new javax.swing.JLabel();
          inst_id = new javax.swing.JTextField();
          jButton8 = new javax.swing.JButton();
          jLabel2 = new javax.swing.JLabel();
          jButton10 = new javax.swing.JButton();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          setPreferredSize(new java.awt.Dimension(600, 300));
          setResizable(false);
  
          jPanel1.setBackground(new java.awt.Color(0, 64, 128));
          jPanel1.setPreferredSize(new java.awt.Dimension(600, 300));
  
          Inst_Name.setBackground(new java.awt.Color(173, 216, 230));
  
          inst_name.setText("Enter new Instructor's name");
          inst_name.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  inst_nameActionPerformed(evt);
              }
          });
  
          Name_Button.setBackground(new java.awt.Color(0, 64, 128));
          Name_Button.setForeground(new java.awt.Color(255, 255, 255));
          Name_Button.setText("Enter");
          Name_Button.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  Name_ButtonActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout Inst_NameLayout = new javax.swing.GroupLayout(Inst_Name);
          Inst_Name.setLayout(Inst_NameLayout);
          Inst_NameLayout.setHorizontalGroup(
              Inst_NameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(Inst_NameLayout.createSequentialGroup()
                  .addGap(25, 25, 25)
                  .addGroup(Inst_NameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(Name_Button)
                      .addComponent(inst_name, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(33, Short.MAX_VALUE))
          );
          Inst_NameLayout.setVerticalGroup(
              Inst_NameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(Inst_NameLayout.createSequentialGroup()
                  .addGap(45, 45, 45)
                  .addComponent(inst_name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                  .addComponent(Name_Button)
                  .addContainerGap(11, Short.MAX_VALUE))
          );
  
          password.setBackground(new java.awt.Color(173, 216, 230));
  
          pass.setText("New password");
  
          Password_Button.setBackground(new java.awt.Color(0, 64, 128));
          Password_Button.setForeground(new java.awt.Color(255, 255, 255));
          Password_Button.setText("Enter");
          Password_Button.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  Password_ButtonActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout passwordLayout = new javax.swing.GroupLayout(password);
          password.setLayout(passwordLayout);
          passwordLayout.setHorizontalGroup(
              passwordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(passwordLayout.createSequentialGroup()
                  .addGap(33, 33, 33)
                  .addGroup(passwordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(Password_Button)
                      .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(25, Short.MAX_VALUE))
          );
          passwordLayout.setVerticalGroup(
              passwordLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(passwordLayout.createSequentialGroup()
                  .addGap(49, 49, 49)
                  .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(Password_Button)
                  .addContainerGap(12, Short.MAX_VALUE))
          );
  
          department.setBackground(new java.awt.Color(173, 216, 230));
  
          dept.setText("New Department Id");
  
          Department_Button.setBackground(new java.awt.Color(0, 64, 128));
          Department_Button.setForeground(new java.awt.Color(255, 255, 255));
          Department_Button.setText("Enter");
          Department_Button.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  Department_ButtonActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout departmentLayout = new javax.swing.GroupLayout(department);
          department.setLayout(departmentLayout);
          departmentLayout.setHorizontalGroup(
              departmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(departmentLayout.createSequentialGroup()
                  .addGap(19, 19, 19)
                  .addGroup(departmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(Department_Button)
                      .addComponent(dept, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(39, Short.MAX_VALUE))
          );
          departmentLayout.setVerticalGroup(
              departmentLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(departmentLayout.createSequentialGroup()
                  .addGap(47, 47, 47)
                  .addComponent(dept, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(Department_Button)
                  .addContainerGap(14, Short.MAX_VALUE))
          );
  
          Salary.setBackground(new java.awt.Color(173, 216, 230));
  
          salary.setText("New Salary");
  
          Salary_Button.setBackground(new java.awt.Color(0, 64, 128));
          Salary_Button.setForeground(new java.awt.Color(255, 255, 255));
          Salary_Button.setText("Enter");
          Salary_Button.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  Salary_ButtonActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout SalaryLayout = new javax.swing.GroupLayout(Salary);
          Salary.setLayout(SalaryLayout);
          SalaryLayout.setHorizontalGroup(
              SalaryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(SalaryLayout.createSequentialGroup()
                  .addGap(20, 20, 20)
                  .addGroup(SalaryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(Salary_Button)
                      .addComponent(salary, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addContainerGap(38, Short.MAX_VALUE))
          );
          SalaryLayout.setVerticalGroup(
              SalaryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(SalaryLayout.createSequentialGroup()
                  .addGap(49, 49, 49)
                  .addComponent(salary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(Salary_Button)
                  .addContainerGap(13, Short.MAX_VALUE))
          );
  
          name_button.setBackground(new java.awt.Color(10, 50, 100));
          name_button.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  name_buttonMouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  name_buttonMouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  name_buttonMousePressed(evt);
              }
          });
  
          a1.setForeground(new java.awt.Color(255, 255, 255));
          a1.setText("Update Instructor's name");
  
          javax.swing.GroupLayout name_buttonLayout = new javax.swing.GroupLayout(name_button);
          name_button.setLayout(name_buttonLayout);
          name_buttonLayout.setHorizontalGroup(
              name_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(name_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                  .addGap(14, 14, 14))
          );
          name_buttonLayout.setVerticalGroup(
              name_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(name_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a1)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          salary_button.setBackground(new java.awt.Color(10, 50, 100));
          salary_button.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  salary_buttonMouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  salary_buttonMouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  salary_buttonMousePressed(evt);
              }
          });
  
          a3.setForeground(new java.awt.Color(255, 255, 255));
          a3.setText("Update Instructor's Salary");
  
          javax.swing.GroupLayout salary_buttonLayout = new javax.swing.GroupLayout(salary_button);
          salary_button.setLayout(salary_buttonLayout);
          salary_buttonLayout.setHorizontalGroup(
              salary_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(salary_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a3, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
          salary_buttonLayout.setVerticalGroup(
              salary_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(salary_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a3)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          password_button.setBackground(new java.awt.Color(10, 50, 100));
          password_button.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  password_buttonMouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  password_buttonMouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  password_buttonMousePressed(evt);
              }
          });
  
          a7.setForeground(new java.awt.Color(255, 255, 255));
          a7.setText("Update Instructort's Password");
  
          javax.swing.GroupLayout password_buttonLayout = new javax.swing.GroupLayout(password_button);
          password_button.setLayout(password_buttonLayout);
          password_buttonLayout.setHorizontalGroup(
              password_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(password_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a7, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
          password_buttonLayout.setVerticalGroup(
              password_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, password_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a7, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                  .addContainerGap())
          );
  
          department_button.setBackground(new java.awt.Color(10, 50, 100));
          department_button.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  department_buttonMouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  department_buttonMouseExited(evt);
              }
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  department_buttonMousePressed(evt);
              }
          });
  
          a5.setForeground(new java.awt.Color(255, 255, 255));
          a5.setText("Update Instructor's Department");
  
          javax.swing.GroupLayout department_buttonLayout = new javax.swing.GroupLayout(department_button);
          department_button.setLayout(department_buttonLayout);
          department_buttonLayout.setHorizontalGroup(
              department_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, department_buttonLayout.createSequentialGroup()
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                  .addComponent(a5)
                  .addGap(20, 20, 20))
          );
          department_buttonLayout.setVerticalGroup(
              department_buttonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(department_buttonLayout.createSequentialGroup()
                  .addContainerGap()
                  .addComponent(a5)
                  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          );
  
          inst_id.setText("Enter Instructor'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
  
          jButton10.setBackground(new java.awt.Color(0, 64, 128));
          jButton10.setForeground(new java.awt.Color(255, 255, 255));
          jButton10.setText("back");
          jButton10.addMouseListener(new java.awt.event.MouseAdapter() {
              public void mousePressed(java.awt.event.MouseEvent evt) {
                  jButton10MousePressed(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(inst_id, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                          .addComponent(jButton8)
                          .addGap(18, 18, 18)
                          .addComponent(jButton10))
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addComponent(Inst_Name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(Salary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                          .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                          .addComponent(department, 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)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                      .addComponent(password_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(department_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(salary_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                      .addComponent(name_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                  .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGap(31, 31, 31))
          );
          jPanel1Layout.setVerticalGroup(
              jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(jPanel1Layout.createSequentialGroup()
                  .addGap(15, 15, 15)
                  .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                      .addComponent(jLabel2)
                      .addGroup(jPanel1Layout.createSequentialGroup()
                          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                              .addComponent(inst_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                              .addComponent(jButton8)
                              .addComponent(jButton10))
                          .addGap(18, 18, 18)
                          .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                              .addComponent(Salary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                              .addComponent(Inst_Name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                              .addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                              .addGroup(jPanel1Layout.createSequentialGroup()
                                  .addComponent(password_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                  .addComponent(department_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                  .addComponent(salary_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                  .addComponent(name_button, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                              .addComponent(department, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                  .addContainerGap(53, 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.DEFAULT_SIZE, 1607, Short.MAX_VALUE)
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE)
          );
  
          pack();
      }// </editor-fold>//GEN-END:initComponents
  
      private void inst_nameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inst_nameActionPerformed
          // TODO add your handling code here:
      }//GEN-LAST:event_inst_nameActionPerformed
  
      private void name_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_name_buttonMouseEntered
          // TODO add your handling code here:
          a1.setForeground(new java.awt.Color(173, 216, 230));
      }//GEN-LAST:event_name_buttonMouseEntered
  
      private void name_buttonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_name_buttonMouseExited
          // TODO add your handling code here:
          a1.setForeground(Color.WHITE);
      }//GEN-LAST:event_name_buttonMouseExited
  
      private void name_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_name_buttonMousePressed
          // TODO add your handling code here:
          Inst_Name.setVisible(true);
          department.setVisible(false);
          password.setVisible(false);
          Salary.setVisible(false);
      }//GEN-LAST:event_name_buttonMousePressed
  
      private void salary_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salary_buttonMouseEntered
          // TODO add your handling code here:
          a3.setForeground(new java.awt.Color(173, 216, 230));
      }//GEN-LAST:event_salary_buttonMouseEntered
  
      private void salary_buttonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salary_buttonMouseExited
          // TODO add your handling code here:
          a3.setForeground(Color.WHITE);
      }//GEN-LAST:event_salary_buttonMouseExited
  
      private void salary_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salary_buttonMousePressed
          // TODO add your handling code here:
          Inst_Name.setVisible(false);
          department.setVisible(false);
          password.setVisible(false);
          Salary.setVisible(true);
      }//GEN-LAST:event_salary_buttonMousePressed
  
      private void password_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_password_buttonMouseEntered
          // TODO add your handling code here:
          a7.setForeground(new java.awt.Color(173, 216, 230));
      }//GEN-LAST:event_password_buttonMouseEntered
  
      private void password_buttonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_password_buttonMouseExited
          // TODO add your handling code here:
          a7.setForeground(Color.WHITE);
      }//GEN-LAST:event_password_buttonMouseExited
  
      private void password_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_password_buttonMousePressed
          // TODO add your handling code here:
          Inst_Name.setVisible(false);
          department.setVisible(false);
          password.setVisible(true);
          Salary.setVisible(false);
      }//GEN-LAST:event_password_buttonMousePressed
  
      private void department_buttonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_department_buttonMouseEntered
          // TODO add your handling code here:
          a5.setForeground(new java.awt.Color(173, 216, 230));
      }//GEN-LAST:event_department_buttonMouseEntered
  
      private void department_buttonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_department_buttonMouseExited
          // TODO add your handling code here:
          a5.setForeground(Color.WHITE);
      }//GEN-LAST:event_department_buttonMouseExited
  
      private void department_buttonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_department_buttonMousePressed
          // TODO add your handling code here:
          Inst_Name.setVisible(false);
          department.setVisible(true);
          password.setVisible(false);
          Salary.setVisible(false);
      }//GEN-LAST:event_department_buttonMousePressed
  
      private void jButton10MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton10MousePressed
          // TODO add your handling code here:
          systemManag s = new systemManag();
          s.setVisible(true);
          s.setLocationRelativeTo(null);//center
          this.dispose();
      }//GEN-LAST:event_jButton10MousePressed
  
      private void Name_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Name_ButtonActionPerformed
          // TODO add your handling code here:
          String Name = inst_name.getText();
          int instructor_id = Integer.parseInt(inst_id.getText());
  
  // Database operation
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Instructor SET Instructor_Name = ? WHERE Instructor_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setString(1, Name);
              preparedStatement.setInt(2, instructor_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Instructor 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_Name_ButtonActionPerformed
  
      private void Salary_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Salary_ButtonActionPerformed
          // TODO add your handling code here:
          // TODO add your handling code here:
          int Salaryy = Integer.parseInt(salary.getText());
          int instructor_id = Integer.parseInt(inst_id.getText());
  
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Instructor SET Salary = ? WHERE Instructor_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setInt(1, Salaryy);
              preparedStatement.setInt(2, instructor_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Instructor Salary 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_Salary_ButtonActionPerformed
  
      private void Password_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Password_ButtonActionPerformed
          // TODO add your handling code here:
          // TODO add your handling code here:
          // TODO add your handling code here:
          String passs = pass.getText();
          int instructor_id = Integer.parseInt(inst_id.getText());
  
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Instructor SET Instructor_Password = ? WHERE Instructor_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setString(1, passs);
              preparedStatement.setInt(2, instructor_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Instructor 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_Password_ButtonActionPerformed
  
      private void Department_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Department_ButtonActionPerformed
          // TODO add your handling code here:
          int id = Integer.parseInt(dept.getText());
          int instructor_id = Integer.parseInt(inst_id.getText());
  
          try (Connection connection = ConnectToDB.getConnection(); java.sql.PreparedStatement preparedStatement = connection.prepareStatement(
                  "UPDATE Instructor SET Dept_ID = ? WHERE Instructor_ID = ?;")) {
  
              // Set values for the prepared statement
              preparedStatement.setInt(1, id);
              preparedStatement.setInt(2, instructor_id);
  
              // Execute the insert operation
              preparedStatement.executeUpdate();
  
              // Success message
              JOptionPane.showMessageDialog(this, "Instructor Department 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_Department_ButtonActionPerformed
  
      /**
       * @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_Instructor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (InstantiationException ex) {
              java.util.logging.Logger.getLogger(Update_Instructor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (IllegalAccessException ex) {
              java.util.logging.Logger.getLogger(Update_Instructor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (javax.swing.UnsupportedLookAndFeelException ex) {
              java.util.logging.Logger.getLogger(Update_Instructor.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_Instructor().setVisible(true);
              }
          });
      }
  
      // Variables declaration - do not modify//GEN-BEGIN:variables
      private javax.swing.JButton Department_Button;
      private javax.swing.JPanel Inst_Name;
      private javax.swing.JButton Name_Button;
      private javax.swing.JButton Password_Button;
      private javax.swing.JPanel Salary;
      private javax.swing.JButton Salary_Button;
      private javax.swing.JLabel a1;
      private javax.swing.JLabel a3;
      private javax.swing.JLabel a5;
      private javax.swing.JLabel a7;
      private javax.swing.JPanel department;
      private javax.swing.JPanel department_button;
      private javax.swing.JTextField dept;
      private javax.swing.JTextField inst_id;
      private javax.swing.JTextField inst_name;
      private javax.swing.JButton jButton10;
      private javax.swing.JButton jButton8;
      private javax.swing.JLabel jLabel2;
      private javax.swing.JPanel jPanel1;
      private javax.swing.JPanel name_button;
      private javax.swing.JTextField pass;
      private javax.swing.JPanel password;
      private javax.swing.JPanel password_button;
      private javax.swing.JTextField salary;
      private javax.swing.JPanel salary_button;
      // End of variables declaration//GEN-END:variables
  }
  