What is the right way to communicate between two Controller Classes in JavaFX?
For example:
public class Controller {
@FXML
private Label label;
@FXML
private void initialize(){
label.setText("A Label");
}
public void setLabelText(String labelText){
label.setText(labelText);
}
}
How can I call the method setLabelText() from another Controller Class without making it static?