java javafx how to hide the button on click

java javafx how to hide the button on click
‮ refer‬to:lautturi.com
public void hideButton(ActionEvent event) {
    Button source = (Button) event.getSource();
    source.setVisible(false);
    System.out.println("pick: "+source.getUserData());
}
Created Time:2017-09-12 09:25:20  Author:lautturi