/** * Java File for the MainWindow Controller. */ package de.fhswf.in.inf.java2.aufgabe02; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.layout.BorderPane; import javafx.scene.layout.StackPane; /** * The controller for the MainWindow FXML. * * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class MainWindow extends BorderPane { @FXML private Button button1; @FXML private Button button2; @FXML private Button button3; @FXML private StackPane sPane; /** * Constructor empty on purpose. * */ public MainWindow() { } /** * Connects the CardChangeEvent and the Buttons. * */ @FXML private void initialize() { button1 .setOnAction(new CardChangeEvent(sPane.getChildren(), "Panel 1")); button2 .setOnAction(new CardChangeEvent(sPane.getChildren(), "Panel 2")); button3 .setOnAction(new CardChangeEvent(sPane.getChildren(), "Panel 3")); } }