Skip to content

Instantly share code, notes, and snippets.

@ennerf
Created May 28, 2022 18:05
Show Gist options
  • Select an option

  • Save ennerf/462f0c1127cc1fcb6ba8bf9ff9e1cb13 to your computer and use it in GitHub Desktop.

Select an option

Save ennerf/462f0c1127cc1fcb6ba8bf9ff9e1cb13 to your computer and use it in GitHub Desktop.
Blog FXML Files
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.StackPane?>
<StackPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="us.hebi.gui.ViewController">
<children>
<Button fx:id="button" text="Change to View 2"/>
</children>
</StackPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.StackPane?>
<StackPane xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="us.hebi.gui.ViewController">
<children>
<Button fx:id="button" text="Change to View 1"/>
</children>
</StackPane>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.StackPane?>
<StackPane fx:id="root" xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="us.hebi.gui.ViewSwitchAppController"
prefHeight="500.0" prefWidth="500.0">
<children>
<fx:include fx:id="view1" source="view1.fxml"/>
<fx:include fx:id="view2" source="view2.fxml"/>
</children>
</StackPane>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment