Created
September 4, 2012 14:07
-
-
Save shemnon/3621462 to your computer and use it in GitHub Desktop.
GroovyFX 3.0 FXML integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import java.lang.*?> | |
<?import javafx.scene.*?> | |
<?import javafx.scene.control.*?> | |
<?import javafx.scene.layout.*?> | |
<AnchorPane xmlns:fx="http://javafx.com/fxml" | |
id="AnchorPane" | |
prefHeight="150.0" prefWidth="320.0" > | |
<children> | |
<Button id="buttonCSSID" | |
layoutX="40.0" layoutY="65.0" | |
prefWidth="100.0" | |
text="Click Me!" /> | |
<Label id="labelCSSID" | |
alignment="CENTER" contentDisplay="CENTER" | |
layoutX="40.0" layoutY="100.0" | |
minHeight="16.0" minWidth="69.0" | |
prefHeight="16.0" prefWidth="100.0" /> | |
<Button fx:id="buttonFXID" | |
layoutX="180.0" layoutY="65.0" | |
prefWidth="100.0" text="Click Me!" /> | |
<Label fx:id="labelFXID" | |
alignment="CENTER" contentDisplay="CENTER" | |
layoutX="180.0" layoutY="100.0" | |
minHeight="16.0" minWidth="69.0" | |
prefHeight="16.0" prefWidth="100.0" /> | |
</children> | |
</AnchorPane> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fxml resource("/FXMLDemoInline.fxml"), { | |
buttonCSSID.onAction { | |
labelCSSID.text = "Clicked - CSS"; | |
} | |
buttonFXID.onAction { | |
labelFXID.text = "Clicked - FXML"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment