1: menu.fxml | Scherm1.fxml | Scherm2.fxml- Vergeet de "yourpackage" van fx:contrplller aan te passen.
- Don't forget to adjust the name "yourpackage"
- No te olvides de personalizar el nombre "yourpackage" in su proyecto.
Menu.fxml :
<?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.text.*?> <?scenebuilder-background-color 0x404040ff?> <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="550.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="yourpackage.MenuController"> <children> <VBox id="VBoxSchermMain" alignment="CENTER" prefHeight="550.0" prefWidth="600.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <Label prefHeight="42.0" prefWidth="142.0" text="Keuzescherm" textFill="WHITE"> <font> <Font name="Arial" size="22.0" /> </font> </Label> <Button fx:id="button1" onAction="#aksie_naarscherm1" prefHeight="42.0" prefWidth="296.0" style=" -fx-background-color: radial-gradient(radius 100%, derive(-fx-base,-60%), derive(-fx-base,-80%)), derive(-fx-base,-40%), radial-gradient(radius 100%, derive(-fx-base,-60%), derive(-fx-base,-80%)); -fx-background-insets: 0 0 -1 0, 0, 1, 2; -fx-background-radius: 25, 25, 24; -fx-padding: 0.0em 0.5em 0.0em 0.0em; -fx-alignment: CENTER; -fx-content-display: LEFT; " text="Laad scherm TabPane één" textFill="#99c2ff"> <font> <Font name="System Bold" size="20.0" fx:id="x1" /> </font> </Button> <Button fx:id="button2" font="$x1" onAction="#aksie_naarscherm2" prefHeight="42.0" prefWidth="296.0" style=" -fx-background-color: radial-gradient(radius 100%, derive(-fx-base,-60%), derive(-fx-base,-80%)), derive(-fx-base,-40%), radial-gradient(radius 100%, derive(-fx-base,-60%), derive(-fx-base,-80%)); -fx-background-insets: 0 0 -1 0, 0, 1, 2; -fx-background-radius: 25, 25, 24; -fx-padding: 0.0em 0.5em 0.0em 0.0em; -fx-alignment: CENTER; -fx-content-display: LEFT; " text="Laad scherm TabPane twee" textFill="#74ff33" /> </children> </VBox> </children> </AnchorPane>
Scherm1.fxml :
<?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.text.*?> <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="550.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="yourpackage.Scherm1Controller"> <children> <VBox id="VBoxScherm2" alignment="CENTER" prefHeight="550.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <TabPane prefHeight="500.0" prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS"> <tabs> <Tab text="SCHERM 1 Tab 1"> <content> <AnchorPane id="Content" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" /> </content> </Tab> <Tab text="SCHERM 1 Tab 2"> <content> <AnchorPane id="Content" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" /> </content> </Tab> </tabs> </TabPane> <Button fx:id="button" onAction="#aksie_NaarHoofdscherm" text="Ga naar scherm Menu"> <font> <Font name="System Bold" size="12.0" /> </font> </Button> </children> </VBox> </children> </AnchorPane>
Scherm2.fxml :
<?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.paint.*?> <?import javafx.scene.text.*?> <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="550.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="yourpackage.Scherm2Controller"> <children> <VBox id="VBoxScherm1" alignment="TOP_CENTER" prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <children> <TabPane prefHeight="500.0" prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" VBox.vgrow="ALWAYS"> <tabs> <Tab text="SCHERM 2 Tab 1"> <content> <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="-1.0" prefWidth="-1.0" /> </content> </Tab> <Tab text="SCHERM 2 Tab 2"> <content> <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> </content> </Tab> </tabs> </TabPane> <Button contentDisplay="CENTER" mnemonicParsing="false" onAction="#aksie_NaarHoofdscherm" text="Naar Menu scherm"> <font> <Font name="System Bold" size="12.0" /> </font> </Button> </children> </VBox> </children> </AnchorPane>
2: Start_Schermen_FXMLTest.java
3: SchermBeheer.java
4: MenuController.java
5: Scherm1Controller.java
6: Scherm2Controller.java
|