I have a problem where I would like to access the node of one controller from another one. Essentially what I have is a button on one app (window) that when pushed will open another window that should show some memory statistics.
Once this new window is opened, I set the button (that opens the new window) to disabled, so another cannot be spawned. What I want is that, once the new window is closed, for the button to be re-enabled, but I'm not entirely sure how to do so without setting static methods and buttons, because the classes are in different packages.
This is the code that spawns the new window:
@Override
public void changed(ObservableValue<? extends Toggle> ov,
Toggle toggle, Toggle new_toggle) {
if (new_toggle != null)
setButtonEnabled(false); //DISABLES THE BUTTON
Application performanceApp;
try {
performanceApp = (Application) MemoryVisualizerApp.class.newInstance();
Stage pStage = new Stage();
try {
performanceApp.start(pStage);
} catch (Exception e) {
e.printStackTrace();
}
} catch (InstantiationException | IllegalAccessException e1) {
e1.printStackTrace();
}
}
});