private void usernameKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_usernameKeyPressed
        if(evt.getKeyCode() == KeyEvent.VK_ENTER){
            try {
            String name=username.getText();
            String pass=password.getText();          
            String checkname = null;
            String checkpass;
                        MyCon = new SQLConnection();
                        c = MyCon.getConnection("journal");
                        stmt = c.createStatement();
                        SQL = "SELECT * FROM journal.profile;";
                        rs = stmt.executeQuery(SQL);
                        while(rs.next()){
                            checkname = rs.getString("username");
                            checkpass = rs.getString("password");
                            if(checkname.toUpperCase().equals(name.toUpperCase()) && checkpass.equals(pass)){
                                found = 1;
                                break;
                            }
                            }
                        if(found == 1){
                                MyCon.useUsername(checkname);
                                new ShowProfile().show();
                                System.out.println("Login Ok");
                                this.dispose();
                        }
                        
                        else{
                                System.out.println("Login Fail");
                                loginError.setVisible(true);
                        }
                        
        } catch (SQLException ex) {
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
        }
        }
    }//GEN-LAST:event_usernameKeyPressed