public void delete(String fname, String lname, String id, String major) 
	{
		idError.setText("");
		//System.out.println("id present");	
		fnameLabel.setVisible(true);
	    lnameLabel.setVisible(true);
	    idLabel.setVisible(true);  
	    majorLabel.setVisible(true);
	    fnameField.setVisible(true);
	    lnameField.setVisible(true);
	    idField.setVisible(true);	   
	    majorField.setVisible(true);
	    fnameField.setEnabled(false);
	    lnameField.setEnabled(false);
	    idField.setEnabled(false);
	    majorField.setEnabled(false);
	    deleteButton.setVisible(true);
	    confirmation.setVisible(true);
	    confirmation.setText("");
	   // jb.setVisible(true);
	    //jb.setEnabled(false);
	    
	    
	    fnameField.setText(fname);
	    lnameField.setText(lname);
	    idField.setText(id);
	   // jb.setSelectedItem(course);
	    majorField.setText(major);
	    
	    deleteButton.addActionListener(new ActionListener() {
			
			
			public void actionPerformed(ActionEvent e) {
			    try
				{
			    	FileWriter writer,writer1;
			    	ArrayList<String> tempFname= new ArrayList<String>();
				    ArrayList<String> tempLname= new ArrayList<String>();
				    ArrayList<String> tempId= new ArrayList<String>();
				    //ArrayList<String> tempCourse= new ArrayList<String>();
				    ArrayList<String> tempMajor= new ArrayList<String>();
				    
				    String newStudent=  idField.getText()+" - "+fnameField.getText()+" "+lnameField.getText();
			        System.out.println(newStudent);
				    
				    FileInputStream fstream1 = new FileInputStream("Course.csv");
			        BufferedReader br1 = new BufferedReader(new InputStreamReader(fstream1));
			        String strLine1;
			        while ((strLine1 = br1.readLine()) != null)
			        {
			        	ArrayList<String> tempStudent= new ArrayList<String>();
			        	String[] val = strLine1.split(",");
			        	String newFile = val[1]+" - "+val[0];
			        	System.out.println(newFile);
			        	FileInputStream fstream2 = new FileInputStream(newFile+".csv");
				        BufferedReader br2 = new BufferedReader(new InputStreamReader(fstream2));
				        String strLine2;
				        while ((strLine2 = br2.readLine()) != null)
				        {
				        	System.out.println(strLine2);
				        	tempStudent.add(strLine2);
				        }
				        br2.close();
					    br2.close();   		
					    
					    File file1=new File(newFile+".csv");
					      System.out.println(file1.delete());
				   	    writer1= new FileWriter(newFile+".csv", true);
				   	 for(int a=0;a<tempStudent.size();a++) 
					    {
					    	System.out.println(tempStudent.get(a)+"----");
					    	System.out.println(newStudent+"----");
					    	if(tempStudent.get(a).equals(newStudent))
					    	{			    			   
					    		System.out.println("in if condition");
				    		continue;
					    	
					    	}
					    				    		
					    		writer1.append(tempStudent.get(a)+"\n");
					    		
					    	
					    }
					 writer1.close();
			         }	
			        br1.close();
			        br1.close();
				    
					FileInputStream fstream = new FileInputStream("Students.csv");				
			        BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
			        
			        
			        String strLine;			     
			       while ((strLine = br.readLine()) != null)
			        {
			        	String[] val = strLine.split(",");
			        	System.out.println(val[2]);
			        	tempFname.add(val[0]);
			        	tempLname.add(val[1]);
			        	tempId.add(val[2]);	        	
			        	tempMajor.add(val[3]);
			        	//System.out.println("not in if");
			         }	   
			       System.out.println("clean up");
			       //fstream.close();
			       br.close();
			       br.close();
			       br.close();
			       
			      File file=new File("Students.csv");
			      System.out.println(file.delete());
		   	    writer= new FileWriter("Students.csv", true);
							   
			    for(int a=0;a<tempFname.size();a++) 
			    {
			    	//System.out.println(tempId.get(a));
			    	System.out.println(tempFname.get(a)+", "+tempLname.get(a)+", "+tempId.get(a)+", "+tempMajor.get(a)+"\n");
			    	if(tempId.get(a).equals(idField.getText()))
			    	{			    			   
			    	
		    		continue;
			    	
			    	}
			    	
			    	
			    		writer.append(tempFname.get(a)+",");
			    		writer.append(tempLname.get(a)+",");
			    		writer.append(tempId.get(a)+",");			    		
			    		writer.append(tempMajor.get(a)+"\n");
			    		
			    	
			    }
			 writer.close();
			 
			 
		        
		        
			 confirmation.setForeground(new Color(0x06543E));
			 confirmation.setText("Student details deleted successfully.");
			}
			    catch(IOException e1)
			    {}
			    
				
			}
		});
	
	}