I have a group of ToggleButtons that need to find out their id. Currently I can check the id in the getSource() and toString() method like this:
@FXML
public void btnCell(ActionEvent actionEvent) {
System.out.println(actionEvent.getSource());
}
Prints: ToggleButton[id=btn00, styleClass=toggle-button]''
Can I extract the id without relying on some shady substring busniess on that string?