public boolean checkUser(String login, String password) {
        result = "?";
        ArrayList<User> users;
        try {
            users = DataBase.getInstance().getUsers();
            for (Iterator it = users.iterator(); it.hasNext();) {
                User user = (User) it.next();
                if (user.getLogin().equals(login) && user.getPassword().equals(password)) {
                    result = "OK";
                }
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, e);
        }

        if (this.result.equals("OK")) {
            return true;
        } else {
            return false;
        }
    }