private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        // TODO add your handling code here:
        
        int x=JOptionPane.showConfirmDialog(null,"Are you sure you want to delete this PROJECT?",
            "METROPOLITAN ENGINEERING (PVT) LTD",0,3 );
       
       if(x==0)
       {
        
        int x1 = 0, x2=0;
           try{
           
           String gen = this.selectedItem;
               
           PreparedStatement stmt1 = null;
           PreparedStatement stmt2 = null;
           
           
           
           
           stmt1 = con1.prepareStatement("update project set pAvailability='NO' where pID=? ");
           
           stmt1.setString(1, gen);
           x1 = stmt1.executeUpdate();
    
           
           
           
           }
           catch(Exception e)
           {
               System.out.println(e.getMessage());
           }
       
           
        
          if(x1>0 )
          {
              JOptionPane.showMessageDialog(null, "Record deleted sucessfully! ","METROPOLITAN ENGINEERING (PVT) LTD", 1);
              
               String query1 = "select pID as 'ID', pName as 'Name', pSdate as 'Start Date', pEndDate as 'End Date',  pGsupplier as 'Global Supplier', pStatus as 'Project Status'  from project where pAvailability = 'YES' ";


        ResultSet result= db1.executeSQLQuery(query1);

        try {

            int columCount = 0;
            ResultSetMetaData rsmd = result.getMetaData();
            Vector myVector = new Vector();
            columCount = rsmd.getColumnCount();
            for (int i = 1; i <= columCount; i++) {
                myVector.add(rsmd.getColumnLabel(i));
            }
            DefaultTableModel amodel = new DefaultTableModel(myVector, 0)/*0=row count*/ {
                @Override
                public boolean isCellEditable(int row, int column) {
                    //all cells false
                    return false;
                }
            };

            while (result.next()) {
                String[] rowData = new String[columCount];
                for (int i = 1; i <= columCount; i++) {
                    if (i == 1) {
                        String id = result.getString(i);
                        rowData[i - 1] = id.toUpperCase();
                    } else {
                        rowData[i - 1] = result.getString(i);
                    }
                }
                amodel.addRow(rowData);
            }

            tableSummaryProjects.setModel(amodel);

        } catch (Exception e) {
            JOptionPane.showMessageDialog(this, "Error in Showing Data", "METROPOLITAN ENGINEERING (PVT) LTD", 1);
        }
        
               
         
          }
           else
               JOptionPane.showMessageDialog(null, "Error in Database. Please Reconnect! ","METROPOLITAN ENGINEERING (PVT) LTD", 1);
          
          loadEditProjectList();
       }
    }