vendredi 29 janvier 2021

How can I get the int i value in the javaFX for loop into if else?

LocalDate rst = LocalDate.of(2003, 1, 1);

LocalDate bdDate = dtDogum.getValue();

    for (int i = 0; i < personal.size(); i++) { 
        if (bdDate.isAfter(rst)) {
            hatamesajı.setTitle("Error");
            hatamesajı.setHeaderText("Personnel to be registered are under the age of 18");
            hatamesajı.show();
            return;
        }       
    }

I am coding a personnel registration program. A user under 18 gives a warning when registered. However, even though the first registration is under the age of 18, it does not give any warning. I think it is because I cannot place the int i value inside the for loop in the if block. How can I place it?

Aucun commentaire:

Enregistrer un commentaire