Skip to content

Instantly share code, notes, and snippets.

@Groostav
Created September 4, 2019 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Groostav/13b24ac6b9039dab0e3a4dc75259a40c to your computer and use it in GitHub Desktop.
Save Groostav/13b24ac6b9039dab0e3a4dc75259a40c to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import custommenu.view.ContextMenuPane?>
<AnchorPane xmlns:fx="http://javafx.com/fxml" fx:controller="custommenu.controller.CustomMenuController">
<children>
<VBox fx:id="vbox" onContextMenuRequested="#showMenu"
onMousePressed="#hideMenu" prefHeight="200" prefWidth="200">
</VBox>
<!-- this lets you skip the ContextMenuPane class, but requires all your wiring be done by your controller -->
<!-- scene builder will render this file and simply skip this block -->
<fx:define>
<ContextMenu fx:id="menu">
<items>
<MenuItem text="add" onAction="#add" />
</items>
</ContextMenu>
</fx:define>
</children>
</AnchorPane>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment