private void logonButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logonButtonActionPerformed
        userName = "";
        password = null;    
        // getting data from textfield and password field and storing in variable
        userName = usernameTF.getText();
        password = passwordTf.getPassword();
        String pass = generatePass(password);
        
        //storing username and password to use later
        //Login l = new Login();
        //l.setUsername(userName);
        
        //used to store values retrieved from the database
        String user1 =null;
        String pass1 =null;
        
        //getting password
        try {
            loginRowSet.setCommand("SELECT * FROM agents WHERE username = ? AND password = ?");
            loginRowSet.setString(1, userName);
            loginRowSet.setString(2, pass);
            loginRowSet.execute();

            if (loginRowSet.first()) {
                user1 = loginRowSet.getString("username");
                pass1 = loginRowSet.getString("password");
                
                
                
            }
            if(user1 != null && pass1 != null){
            if (userName.equals(user1) && pass.equals(pass1)){
                    
                //get time stamp
                String date = getDate();
                
                
                JOptionPane.showMessageDialog(this, "Welcome " + user1 + ", You have successfully Login");
                mainMenuFrame next = new mainMenuFrame(user1, date);
                next.setVisible(true);
                this.setVisible(false);
            } else {
                JOptionPane.showMessageDialog(this, "Incorrect username and pasword combination, Please try again", "Error", JOptionPane.ERROR_MESSAGE);
            }
            
            }
            else{
                JOptionPane.showMessageDialog(this, "Incorrect username and pasword combination, Please try again", "Error", JOptionPane.ERROR_MESSAGE);
            }
        }
         catch (SQLException ex) {
            Logger.getLogger(LoginFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    
    




    }//GEN-LAST:event_logonButtonActionPerformed