how to make a button disapear on click in javafx

Java
public void letterChosen(ActionEvent event) {
    Button source = (Button) event.getSource();
    source.setVisible(false);
    System.out.println("pick: "+source.getUserData());
}
Source

Also in Java: