Good evening! There is a code, the text should change after a pause, but an exception is thrown, why? How to write correctly?
public void initialize(URL fxmlFileLocation, ResourceBundle resources) { loginfield.setStyle("-fx-font: 25 calibri"); btn.setOnAction( event -> { if (loginfield.getText().equals(login)) { result.setText("Your login is right"); Thread.sleep(1000); result.setText("Logged in"); } else if (loginfield.getText().isEmpty()) { result.setText("You have typed nothing"); } else if (loginfield.getText() != login) { result.setText("Your login isn't right"); } } ); }