package app; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Node; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.stage.Stage; import java.awt.event.ActionEvent; import java.io.IOException; public class HomeController { @FXML private Label middle; public void clickLeftButton() { middle.setText("The button on the left was clicked."); } public void clickRightButton() { middle.setText("The button on the right was clicked."); } public void clickBottomButton() { middle.setText("This is the starter text."); } public void switchScreen(javafx.event.ActionEvent event) throws IOException { Parent parent = FXMLLoader.load(getClass().getResource("secondScreen.fxml")); Scene scene = new Scene(parent); Stage window = (Stage)((Node)event.getSource()).getScene().getWindow(); window.setScene(scene); window.show(); } }