'How I access objects which I create in scene builder? JAVAFX
For example, I created a grid pane, added text areas into every cell. Now I want to get grid pane as an Object to do something with it in my Controller class? How can I do that?
For example, to get Button you just add ActionEvent parameter and on click you can get an buttton object.
@FXML
protected void restartButton(ActionEvent event) {
Button btn = (Button) event.getSource();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|