My task is to call a single method on clicking 3 buttons in javafx and that particular method execute the code that simply change the color of the button which is clicked.
According to the scene i have created 3 buttons in fxml and inside my controller i have defined a method. The code for my task is simply
myButton.setStyle("-fx-background-color:green");
Now would you please tell me that how can i get that particular button id that is clicked. Here myButton is the fx:id of the button that is clicked.
Thanks in advance.
onAction="#methodName"for each button as shown in this example - ItachiUchiha