samedi 16 février 2019

How to disable button if the TextField empty?

I cant disable my button. "accept" = button , "email" = textField.

email.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) 
            {
                if(email.getText().isEmpty() == false)
                {
                    accept.setDisable(false);

                }else accept.setDisable(true);
            }
        });```

It isnt do anything, if I write in the textField.



Aucun commentaire:

Enregistrer un commentaire