I'm using JavaFX to make a login app that switches to a new scene when the user clicks a button. When in the controller class, how do I access my ReplaceSceneContent() function in the main application? This is the code I have so far, which gives an error message:
public class MainScreenController implements Initializable {
private FXMLStephensPetrochko application;
public void setApp(FXMLStephensPetrochko app){
this.application = app;
}
@Override
public void initialize(URL url, ResourceBundle rb) {
}
public void Pressed (ActionEvent e){
try{
application.replaceSceneContent("LoggedIn.fxml");
}catch (Exception exc) {
exc.printStackTrace();
}
System.out.println("Button Pressed!");
}
}