Javafx, how to bound 2 functions of one button : Hellow guys, today i come across another problem.
Here is a part of my code. I've got there 2 functions which i want to be assigned to the one Button (Log In), how can i do that ?

    @FXML
    private void fireLogIn()
    {
    	LogInButton.setOnKeyPressed(event -> {
    		   if(event.getCode() == KeyCode.ENTER){
    		     LogIn(event); // <--- there is an error of wrong type of data 
    		   }
    		}); 
    }
    
    
    @FXML
    private void LogIn(ActionEvent event) throws IOException {
        if(LoginField.getText().equals("MKARK")&&PasswdField.getText().equals("KACZOR1"))
        {
            Parent parent = FXMLLoader.load(getClass().getResource("/fxmlFiles/MainScreen.fxml"));
            Scene MainScene = new Scene(parent);
            Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
            stage.setScene(MainScene);
            stage.show();
            
        
        }
        else
        {
        	IncorrectDataLink.setVisible(true);
        	IncorrectDataLink.setOnAction(e-> openWebpage(uri));	
    }
    
    }
I want to provide both facilities, pressing the button by mouse or pressing an "ENTER"" botton whenever it's focused on it :(.